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 Network; | 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 14 matching lines...) Expand all Loading... |
42 | 42 |
43 // Called from UI to update proxy configuration for different modes. Stores | 43 // Called from UI to update proxy configuration for different modes. Stores |
44 // and persists |config| to shill for the current network. | 44 // and persists |config| to shill for the current network. |
45 void SetProxyConfig(const UIProxyConfig& config); | 45 void SetProxyConfig(const UIProxyConfig& config); |
46 | 46 |
47 private: | 47 private: |
48 // Determines effective proxy config based on prefs from config tracker, | 48 // Determines effective proxy config based on prefs from config tracker, |
49 // |network| and if user is using shared proxies. The effective config is | 49 // |network| and if user is using shared proxies. The effective config is |
50 // stored in |current_ui_config_| but not activated on network stack, and | 50 // stored in |current_ui_config_| but not activated on network stack, and |
51 // hence, not picked up by observers. | 51 // hence, not picked up by observers. |
52 void DetermineEffectiveConfig(const Network& network); | 52 void DetermineEffectiveConfig(const NetworkState& network); |
53 | 53 |
54 // Service path of network whose proxy configuration is being displayed or | 54 // Service path of network whose proxy configuration is being displayed or |
55 // edited via UI. | 55 // edited via UI. |
56 std::string current_ui_network_; | 56 std::string current_ui_network_; |
57 | 57 |
58 // Proxy configuration of |current_ui_network_|. | 58 // Proxy configuration of |current_ui_network_|. |
59 UIProxyConfig current_ui_config_; | 59 UIProxyConfig current_ui_config_; |
60 | 60 |
61 PrefService* pref_service_; | 61 PrefService* pref_service_; |
62 | 62 |
63 DISALLOW_COPY_AND_ASSIGN(UIProxyConfigService); | 63 DISALLOW_COPY_AND_ASSIGN(UIProxyConfigService); |
64 }; | 64 }; |
65 | 65 |
66 } // namespace chromeos | 66 } // namespace chromeos |
67 | 67 |
68 #endif // CHROME_BROWSER_CHROMEOS_UI_PROXY_CONFIG_SERVICE_H_ | 68 #endif // CHROME_BROWSER_CHROMEOS_UI_PROXY_CONFIG_SERVICE_H_ |
OLD | NEW |