| Index: chrome/browser/resources/options/browser_options.js
|
| diff --git a/chrome/browser/resources/options/browser_options.js b/chrome/browser/resources/options/browser_options.js
|
| index 70be566e74f3d0b96a07d2dd5b43ca6ce15596e3..6a7bb468889ecb7dafe98a768772ecf697471439 100644
|
| --- a/chrome/browser/resources/options/browser_options.js
|
| +++ b/chrome/browser/resources/options/browser_options.js
|
| @@ -9,6 +9,11 @@ cr.define('options', function() {
|
| var ArrayDataModel = cr.ui.ArrayDataModel;
|
| var RepeatingButton = cr.ui.RepeatingButton;
|
| var HotwordSearchSettingIndicator = options.HotwordSearchSettingIndicator;
|
| + var NetworkPredictionOptions = {
|
| + ALWAYS: 0,
|
| + WIFI_ONLY: 1,
|
| + NEVER: 2
|
| + };
|
|
|
| //
|
| // BrowserOptions class
|
| @@ -350,6 +355,17 @@ cr.define('options', function() {
|
| [String(event.currentTarget.checked)]);
|
| };
|
| }
|
| + $('networkPredictionOptions').onchange = function(event) {
|
| + var value = (event.target.checked ?
|
| + NetworkPredictionOptions.WIFI_ONLY :
|
| + NetworkPredictionOptions.NEVER);
|
| + var metric = event.target.metric;
|
| + Preferences.setIntegerPref(
|
| + 'net.network_prediction_options',
|
| + value,
|
| + true,
|
| + metric);
|
| + };
|
|
|
| // Bluetooth (CrOS only).
|
| if (cr.isChromeOS) {
|
| @@ -1458,6 +1474,20 @@ cr.define('options', function() {
|
| },
|
|
|
| /**
|
| + * Set network prediction checkbox value.
|
| + *
|
| + * @param {Object} pref Information about network prediction options.
|
| + * @param {number} pref.value The value of network prediction options.
|
| + * @param {boolean} pref.disabled If the pref is not user modifiable.
|
| + * @private
|
| + */
|
| + setNetworkPredictionValue_: function(pref) {
|
| + var checkbox = $('networkPredictionOptions');
|
| + checkbox.disabled = pref.disabled;
|
| + checkbox.checked = !(pref.value == NetworkPredictionOptions.NEVER);
|
| + },
|
| +
|
| + /**
|
| * Set the font size selected item. This item actually reflects two
|
| * preferences: the default font size and the default fixed font size.
|
| *
|
| @@ -1840,6 +1870,7 @@ cr.define('options', function() {
|
| 'setCanSetTime',
|
| 'setFontSize',
|
| 'setNativeThemeButtonEnabled',
|
| + 'setNetworkPredictionValue',
|
| 'setHighContrastCheckboxState',
|
| 'setMetricsReportingCheckboxState',
|
| 'setMetricsReportingSettingVisibility',
|
|
|