OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_PROXY_CROS_SETTINGS_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_PROXY_CROS_SETTINGS_PROVIDER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_PROXY_CROS_SETTINGS_PROVIDER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_PROXY_CROS_SETTINGS_PROVIDER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
11 #include "chrome/browser/chromeos/cros_settings_provider.h" | 11 #include "chrome/browser/chromeos/cros_settings_provider.h" |
12 #include "chrome/browser/chromeos/proxy_config_service_impl.h" | 12 #include "chrome/browser/chromeos/proxy_config_service_impl.h" |
13 | 13 |
14 namespace chromeos { | 14 namespace chromeos { |
15 | 15 |
16 class ProxyCrosSettingsProvider : public CrosSettingsProvider { | 16 class ProxyCrosSettingsProvider : public CrosSettingsProvider { |
17 public: | 17 public: |
18 ProxyCrosSettingsProvider(); | 18 ProxyCrosSettingsProvider(); |
19 // CrosSettingsProvider implementation. | 19 // CrosSettingsProvider implementation. |
20 virtual bool Get(const std::string& path, Value** out_value) const OVERRIDE; | 20 virtual bool Get(const std::string& path, Value** out_value) const OVERRIDE; |
21 virtual bool HandlesSetting(const std::string& path) const OVERRIDE; | 21 virtual bool HandlesSetting(const std::string& path) const OVERRIDE; |
22 | 22 |
23 // Set the current user profile whose prefs proxy config, if available, will | |
24 // be disapledy and possibly edited on. | |
Mattias Nissler (ping if slow)
2011/10/07 13:32:10
s/disapled/displayed/
kuan
2011/10/18 16:25:35
function is removed.
| |
25 virtual void SetCurrentUserProfile(Profile* profile); | |
Mattias Nissler (ping if slow)
2011/10/07 13:32:10
This is asking for trouble once multi-profile come
kuan
2011/10/18 16:25:35
i've modified constructor to take in Profile param
| |
26 | |
23 // Set the current network whose proxy settings will be displayed and possibly | 27 // Set the current network whose proxy settings will be displayed and possibly |
24 // edited on. | 28 // edited on. |
25 void SetCurrentNetwork(const std::string& network); | 29 void SetCurrentNetwork(const std::string& network); |
26 | 30 |
27 // Make the active network the current one whose proxy settings will be | 31 // Make the active network the current one whose proxy settings will be |
28 // displayed and possibly edited on. | 32 // displayed and possibly edited on. |
29 void MakeActiveNetworkCurrent(); | 33 void MakeActiveNetworkCurrent(); |
30 | 34 |
31 // Returns name of current network that has been set via SetCurrentNetwork or | 35 // Returns name of current network that has been set via SetCurrentNetwork or |
32 // MakeActiveNetworkCurrent. | 36 // MakeActiveNetworkCurrent. |
33 const std::string& GetCurrentNetworkName() const; | 37 const std::string& GetCurrentNetworkName() const; |
34 | 38 |
35 // Returns true if user has selected to use shared proxies. | |
36 bool IsUsingSharedProxies() const; | |
37 | |
38 private: | 39 private: |
39 // CrosSettingsProvider implementation. | 40 // CrosSettingsProvider implementation. |
40 virtual void DoSet(const std::string& path, Value* value) OVERRIDE; | 41 virtual void DoSet(const std::string& path, Value* value) OVERRIDE; |
41 | 42 |
42 chromeos::ProxyConfigServiceImpl* GetConfigService() const; | 43 chromeos::ProxyConfigServiceImpl* GetConfigService() const; |
43 | 44 |
44 net::ProxyServer CreateProxyServerFromHost( | 45 net::ProxyServer CreateProxyServerFromHost( |
45 const std::string& host, | 46 const std::string& host, |
46 const ProxyConfigServiceImpl::ProxyConfig::ManualProxy& proxy, | 47 const ProxyConfigServiceImpl::ProxyConfig::ManualProxy& proxy, |
47 net::ProxyServer::Scheme scheme) const; | 48 net::ProxyServer::Scheme scheme) const; |
48 | 49 |
49 net::ProxyServer CreateProxyServerFromPort( | 50 net::ProxyServer CreateProxyServerFromPort( |
50 uint16 port, | 51 uint16 port, |
51 const ProxyConfigServiceImpl::ProxyConfig::ManualProxy& proxy, | 52 const ProxyConfigServiceImpl::ProxyConfig::ManualProxy& proxy, |
52 net::ProxyServer::Scheme scheme) const; | 53 net::ProxyServer::Scheme scheme) const; |
53 | 54 |
54 Value* CreateServerHostValue( | 55 Value* CreateServerHostValue( |
55 const ProxyConfigServiceImpl::ProxyConfig::ManualProxy& proxy) const; | 56 const ProxyConfigServiceImpl::ProxyConfig::ManualProxy& proxy) const; |
56 | 57 |
57 Value* CreateServerPortValue( | 58 Value* CreateServerPortValue( |
58 const ProxyConfigServiceImpl::ProxyConfig::ManualProxy& proxy) const; | 59 const ProxyConfigServiceImpl::ProxyConfig::ManualProxy& proxy) const; |
59 | 60 |
60 DISALLOW_COPY_AND_ASSIGN(ProxyCrosSettingsProvider); | 61 DISALLOW_COPY_AND_ASSIGN(ProxyCrosSettingsProvider); |
61 }; | 62 }; |
62 | 63 |
63 } // namespace chromeos | 64 } // namespace chromeos |
64 | 65 |
65 #endif // CHROME_BROWSER_CHROMEOS_PROXY_CROS_SETTINGS_PROVIDER_H_ | 66 #endif // CHROME_BROWSER_CHROMEOS_PROXY_CROS_SETTINGS_PROVIDER_H_ |
OLD | NEW |