OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_CHROMEOS_UI_PROXY_CONFIG_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_UI_PROXY_CONFIG_SERVICE_H_ |
6 #define CHROME_BROWSER_CHROMEOS_UI_PROXY_CONFIG_SERVICE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_UI_PROXY_CONFIG_SERVICE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "chrome/browser/chromeos/ui_proxy_config.h" | 11 #include "chrome/browser/chromeos/ui_proxy_config.h" |
12 | 12 |
13 class PrefService; | 13 class PrefService; |
14 | 14 |
15 namespace chromeos { | 15 namespace chromeos { |
16 | 16 |
17 class FavoriteState; | 17 class NetworkState; |
18 | 18 |
19 // This class is only accessed from the UI via Profile::GetProxyConfigTracker to | 19 // This class is only accessed from the UI via Profile::GetProxyConfigTracker to |
20 // allow the user to read and modify the proxy configuration via | 20 // allow the user to read and modify the proxy configuration via |
21 // GetProxyConfig and SetProxyConfig. | 21 // GetProxyConfig and SetProxyConfig. |
22 // | 22 // |
23 // Before reading/setting a proxy config, a network has to be selected using | 23 // Before reading/setting a proxy config, a network has to be selected using |
24 // either SetCurrentNetwork (any remembered network) or | 24 // either SetCurrentNetwork (any remembered network) or |
25 // MakeActiveNetworkCurrent. | 25 // MakeActiveNetworkCurrent. |
26 class UIProxyConfigService { | 26 class UIProxyConfigService { |
27 public: | 27 public: |
(...skipping 20 matching lines...) Expand all Loading... |
48 | 48 |
49 // Called from UI to update proxy configuration for different modes. Stores | 49 // Called from UI to update proxy configuration for different modes. Stores |
50 // and persists |config| to shill for the current network. | 50 // and persists |config| to shill for the current network. |
51 void SetProxyConfig(const UIProxyConfig& config); | 51 void SetProxyConfig(const UIProxyConfig& config); |
52 | 52 |
53 private: | 53 private: |
54 // Determines effective proxy config based on prefs from config tracker, | 54 // Determines effective proxy config based on prefs from config tracker, |
55 // |network| and if user is using shared proxies. The effective config is | 55 // |network| and if user is using shared proxies. The effective config is |
56 // stored in |current_ui_config_| but not activated on network stack, and | 56 // stored in |current_ui_config_| but not activated on network stack, and |
57 // hence, not picked up by observers. | 57 // hence, not picked up by observers. |
58 void DetermineEffectiveConfig(const FavoriteState& network); | 58 void DetermineEffectiveConfig(const NetworkState& network); |
59 | 59 |
60 // Service path of network whose proxy configuration is being displayed or | 60 // Service path of network whose proxy configuration is being displayed or |
61 // edited via UI. | 61 // edited via UI. |
62 std::string current_ui_network_; | 62 std::string current_ui_network_; |
63 | 63 |
64 // Proxy configuration of |current_ui_network_|. | 64 // Proxy configuration of |current_ui_network_|. |
65 UIProxyConfig current_ui_config_; | 65 UIProxyConfig current_ui_config_; |
66 | 66 |
67 bool signin_screen_; | 67 bool signin_screen_; |
68 | 68 |
69 // Not owned. | 69 // Not owned. |
70 PrefService* profile_prefs_; | 70 PrefService* profile_prefs_; |
71 | 71 |
72 // Not owned. | 72 // Not owned. |
73 PrefService* local_state_prefs_; | 73 PrefService* local_state_prefs_; |
74 | 74 |
75 DISALLOW_COPY_AND_ASSIGN(UIProxyConfigService); | 75 DISALLOW_COPY_AND_ASSIGN(UIProxyConfigService); |
76 }; | 76 }; |
77 | 77 |
78 } // namespace chromeos | 78 } // namespace chromeos |
79 | 79 |
80 #endif // CHROME_BROWSER_CHROMEOS_UI_PROXY_CONFIG_SERVICE_H_ | 80 #endif // CHROME_BROWSER_CHROMEOS_UI_PROXY_CONFIG_SERVICE_H_ |
OLD | NEW |