| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chrome.browser.firstrun; | 5 package org.chromium.chrome.browser.firstrun; |
| 6 | 6 |
| 7 import android.os.Bundle; | 7 import android.os.Bundle; |
| 8 import android.support.v7.widget.SwitchCompat; | 8 import android.support.v7.widget.SwitchCompat; |
| 9 import android.view.LayoutInflater; | 9 import android.view.LayoutInflater; |
| 10 import android.view.View; | 10 import android.view.View; |
| 11 import android.view.View.OnClickListener; | 11 import android.view.View.OnClickListener; |
| 12 import android.view.ViewGroup; | 12 import android.view.ViewGroup; |
| 13 import android.widget.Button; | 13 import android.widget.Button; |
| 14 | 14 |
| 15 import org.chromium.chrome.R; | 15 import org.chromium.chrome.R; |
| 16 import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings; | 16 import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings; |
| 17 import org.chromium.chrome.browser.preferences.datareduction.DataReductionPromoS
creen; | 17 import org.chromium.chrome.browser.preferences.datareduction.DataReductionPromoU
tils; |
| 18 | 18 |
| 19 /** | 19 /** |
| 20 * The First Run Experience fragment that allows the user to opt in to Data Save
r. | 20 * The First Run Experience fragment that allows the user to opt in to Data Save
r. |
| 21 */ | 21 */ |
| 22 public class DataReductionProxyFirstRunFragment extends FirstRunPage { | 22 public class DataReductionProxyFirstRunFragment extends FirstRunPage { |
| 23 | 23 |
| 24 @Override | 24 @Override |
| 25 public View onCreateView( | 25 public View onCreateView( |
| 26 LayoutInflater inflater, ViewGroup container, Bundle savedInstanceSt
ate) { | 26 LayoutInflater inflater, ViewGroup container, Bundle savedInstanceSt
ate) { |
| 27 return inflater.inflate(R.layout.fre_data_reduction_proxy, container, fa
lse); | 27 return inflater.inflate(R.layout.fre_data_reduction_proxy, container, fa
lse); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 56 }); | 56 }); |
| 57 | 57 |
| 58 enableDataSaverSwitch.setChecked(true); | 58 enableDataSaverSwitch.setChecked(true); |
| 59 DataReductionProxySettings.getInstance().setDataReductionProxyEnabled( | 59 DataReductionProxySettings.getInstance().setDataReductionProxyEnabled( |
| 60 view.getContext(), enableDataSaverSwitch.isChecked()); | 60 view.getContext(), enableDataSaverSwitch.isChecked()); |
| 61 } | 61 } |
| 62 | 62 |
| 63 @Override | 63 @Override |
| 64 public void onStart() { | 64 public void onStart() { |
| 65 super.onStart(); | 65 super.onStart(); |
| 66 DataReductionPromoScreen.saveDataReductionPromoDisplayed(getActivity()); | 66 DataReductionPromoUtils.saveFreOrSecondRunPromoDisplayed(); |
| 67 } | 67 } |
| 68 } | 68 } |
| OLD | NEW |