OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_NET_PREDICTION_OPTIONS_H_ | 5 #ifndef CHROME_BROWSER_NET_PREDICTION_OPTIONS_H_ |
6 #define CHROME_BROWSER_NET_PREDICTION_OPTIONS_H_ | 6 #define CHROME_BROWSER_NET_PREDICTION_OPTIONS_H_ |
7 | 7 |
8 namespace user_prefs { | 8 namespace user_prefs { |
9 class PrefRegistrySyncable; | 9 class PrefRegistrySyncable; |
10 } | 10 } |
(...skipping 12 matching lines...) Expand all Loading... |
23 enum NetworkPredictionOptions { | 23 enum NetworkPredictionOptions { |
24 NETWORK_PREDICTION_ALWAYS, | 24 NETWORK_PREDICTION_ALWAYS, |
25 NETWORK_PREDICTION_WIFI_ONLY, | 25 NETWORK_PREDICTION_WIFI_ONLY, |
26 NETWORK_PREDICTION_NEVER, | 26 NETWORK_PREDICTION_NEVER, |
27 NETWORK_PREDICTION_UNSET, | 27 NETWORK_PREDICTION_UNSET, |
28 }; | 28 }; |
29 | 29 |
30 void RegisterPredictionOptionsProfilePrefs( | 30 void RegisterPredictionOptionsProfilePrefs( |
31 user_prefs::PrefRegistrySyncable* registry); | 31 user_prefs::PrefRegistrySyncable* registry); |
32 | 32 |
| 33 // Migrate prefs::kNetworkPredictionEnabled user setting (if exists) to |
| 34 // prefs::kNetworkPredictionOptions (if does not have user setting). |
| 35 void MigrateNetworkPredictionUserPrefs(PrefService* pref_service); |
| 36 |
33 // The following two global functions determine whether predictive network | 37 // The following two global functions determine whether predictive network |
34 // actions are enabled, based on preferences and network type. | 38 // actions are enabled, based on preferences and network type. |
35 | 39 |
36 // To be executed on the IO thread only. | 40 // To be executed on the IO thread only. |
37 bool CanPredictNetworkActionsIO(ProfileIOData* profile_io_data); | 41 bool CanPredictNetworkActionsIO(ProfileIOData* profile_io_data); |
38 | 42 |
39 // To be executed on the UI thread only. | 43 // To be executed on the UI thread only. |
40 bool CanPredictNetworkActionsUI(PrefService* prefs); | 44 bool CanPredictNetworkActionsUI(PrefService* prefs); |
41 | 45 |
42 } // namespace chrome_browser_net | 46 } // namespace chrome_browser_net |
43 | 47 |
44 #endif // CHROME_BROWSER_NET_PREDICTION_OPTIONS_H_ | 48 #endif // CHROME_BROWSER_NET_PREDICTION_OPTIONS_H_ |
OLD | NEW |