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_CONFIG_SERVICE_IMPL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_PROXY_CONFIG_SERVICE_IMPL_H_ |
6 #define CHROME_BROWSER_CHROMEOS_PROXY_CONFIG_SERVICE_IMPL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_PROXY_CONFIG_SERVICE_IMPL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 21 matching lines...) Expand all Loading... | |
32 // - provides UI with methods to retrieve and modify system proxy configuration | 32 // - provides UI with methods to retrieve and modify system proxy configuration |
33 // on UI thread | 33 // on UI thread |
34 // - TODO(kuan): persists proxy configuration settings on chromeos device using | 34 // - TODO(kuan): persists proxy configuration settings on chromeos device using |
35 // cros settings | 35 // cros settings |
36 class ProxyConfigServiceImpl | 36 class ProxyConfigServiceImpl |
37 : public base::RefCountedThreadSafe<ProxyConfigServiceImpl>, | 37 : public base::RefCountedThreadSafe<ProxyConfigServiceImpl>, |
38 public SignedSettings::Delegate<bool>, | 38 public SignedSettings::Delegate<bool>, |
39 public SignedSettings::Delegate<std::string> { | 39 public SignedSettings::Delegate<std::string> { |
40 public: | 40 public: |
41 // ProxyConfigServiceImpl is created on the UI thread in | 41 // ProxyConfigServiceImpl is created on the UI thread in |
42 // chrome/browser/net/chrome_url_request_context.cc::CreateProxyConfigService | 42 // chrome/browser/net/proxy_service_factory.cc::CreateProxyConfigService |
43 // via ProfileImpl::GetChromeOSProxyConfigServiceImpl, and stored in Profile | 43 // via BrowserProcess::chromeos_proxy_config_service_impl, and stored in |
willchan no longer on Chromium
2011/02/21 23:05:49
Won't it be called multiple times? Once for the Br
battre
2011/03/08 17:38:58
No, it is stored in g_browser_process. The instanc
| |
44 // as a scoped_refptr (because it's RefCountedThreadSafe). | 44 // g_browser_process as a scoped_refptr (because it's RefCountedThreadSafe). |
45 // | 45 // |
46 // Past that point, it can be accessed from the IO or UI threads. | 46 // Past that point, it can be accessed from the IO or UI threads. |
47 // | 47 // |
48 // From the IO thread, it is accessed periodically through the wrapper class | 48 // From the IO thread, it is accessed periodically through the wrapper class |
49 // chromeos::ProxyConfigService via net::ProxyConfigService interface | 49 // chromeos::ProxyConfigService via net::ProxyConfigService interface |
50 // (GetLatestProxyConfig, AddObserver, RemoveObserver). | 50 // (GetLatestProxyConfig, AddObserver, RemoveObserver). |
51 // | 51 // |
52 // From the UI thread, it is accessed via | 52 // From the UI thread, it is accessed via |
53 // WebUI::GetProfile::GetChromeOSProxyConfigServiceImpl to allow user to read | 53 // BrowserProcess::chromeos_proxy_config_service_impl to allow user to read |
54 // or modify the proxy configuration via UIGetProxyConfig or | 54 // or modify the proxy configuration via UIGetProxyConfig or |
55 // UISetProxyConfigTo* respectively. | 55 // UISetProxyConfigTo* respectively. |
56 // The new modified proxy config is posted to the IO thread through | 56 // The new modified proxy config is posted to the IO thread through |
57 // SetNewProxyConfig(). We then notify observers on the IO thread of the | 57 // SetNewProxyConfig(). We then notify observers on the IO thread of the |
58 // configuration change. | 58 // configuration change. |
59 | 59 |
60 // In contrary to other platforms which simply use the systems' UI to allow | 60 // In contrary to other platforms which simply use the systems' UI to allow |
61 // users to configure proxies, we have to implement our own UI on the chromeos | 61 // users to configure proxies, we have to implement our own UI on the chromeos |
62 // device. This requires extra and specific UI requirements that | 62 // device. This requires extra and specific UI requirements that |
63 // net::ProxyConfig does not suffice. So we create an augmented analog to | 63 // net::ProxyConfig does not suffice. So we create an augmented analog to |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
270 // respectively. | 270 // respectively. |
271 scoped_refptr<SignedSettings> retrieve_property_op_; | 271 scoped_refptr<SignedSettings> retrieve_property_op_; |
272 scoped_refptr<SignedSettings> store_property_op_; | 272 scoped_refptr<SignedSettings> store_property_op_; |
273 | 273 |
274 DISALLOW_COPY_AND_ASSIGN(ProxyConfigServiceImpl); | 274 DISALLOW_COPY_AND_ASSIGN(ProxyConfigServiceImpl); |
275 }; | 275 }; |
276 | 276 |
277 } // namespace chromeos | 277 } // namespace chromeos |
278 | 278 |
279 #endif // CHROME_BROWSER_CHROMEOS_PROXY_CONFIG_SERVICE_IMPL_H_ | 279 #endif // CHROME_BROWSER_CHROMEOS_PROXY_CONFIG_SERVICE_IMPL_H_ |
OLD | NEW |