OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PREF_PROXY_CONFIG_TRACKER_IMPL_H_ | 5 #ifndef CHROME_BROWSER_NET_PREF_PROXY_CONFIG_TRACKER_IMPL_H_ |
6 #define CHROME_BROWSER_NET_PREF_PROXY_CONFIG_TRACKER_IMPL_H_ | 6 #define CHROME_BROWSER_NET_PREF_PROXY_CONFIG_TRACKER_IMPL_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 // configuration determined by a baseline delegate ProxyConfigService on | 23 // configuration determined by a baseline delegate ProxyConfigService on |
24 // non-ChromeOS platforms. ChromeOS has its own implementation of overrides in | 24 // non-ChromeOS platforms. ChromeOS has its own implementation of overrides in |
25 // chromeos::ProxyConfigServiceImpl. | 25 // chromeos::ProxyConfigServiceImpl. |
26 class ChromeProxyConfigService | 26 class ChromeProxyConfigService |
27 : public net::ProxyConfigService, | 27 : public net::ProxyConfigService, |
28 public net::ProxyConfigService::Observer { | 28 public net::ProxyConfigService::Observer { |
29 public: | 29 public: |
30 // Takes ownership of the passed |base_service|. | 30 // Takes ownership of the passed |base_service|. |
31 // If |wait_for_first_update| is true, GetLatestProxyConfig returns | 31 // If |wait_for_first_update| is true, GetLatestProxyConfig returns |
32 // ConfigAvailability::CONFIG_PENDING until UpdateProxyConfig has been called. | 32 // ConfigAvailability::CONFIG_PENDING until UpdateProxyConfig has been called. |
33 explicit ChromeProxyConfigService(net::ProxyConfigService* base_service, | 33 ChromeProxyConfigService(net::ProxyConfigService* base_service, |
34 bool wait_for_first_update); | 34 bool wait_for_first_update); |
35 virtual ~ChromeProxyConfigService(); | 35 virtual ~ChromeProxyConfigService(); |
36 | 36 |
37 // ProxyConfigService implementation: | 37 // ProxyConfigService implementation: |
38 virtual void AddObserver( | 38 virtual void AddObserver( |
39 net::ProxyConfigService::Observer* observer) OVERRIDE; | 39 net::ProxyConfigService::Observer* observer) OVERRIDE; |
40 virtual void RemoveObserver( | 40 virtual void RemoveObserver( |
41 net::ProxyConfigService::Observer* observer) OVERRIDE; | 41 net::ProxyConfigService::Observer* observer) OVERRIDE; |
42 virtual ConfigAvailability GetLatestProxyConfig( | 42 virtual ConfigAvailability GetLatestProxyConfig( |
43 net::ProxyConfig* config) OVERRIDE; | 43 net::ProxyConfig* config) OVERRIDE; |
44 virtual void OnLazyPoll() OVERRIDE; | 44 virtual void OnLazyPoll() OVERRIDE; |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 | 155 |
156 PrefService* pref_service_; | 156 PrefService* pref_service_; |
157 ChromeProxyConfigService* chrome_proxy_config_service_; // Weak ptr. | 157 ChromeProxyConfigService* chrome_proxy_config_service_; // Weak ptr. |
158 bool update_pending_; // True if config has not been pushed to network stack. | 158 bool update_pending_; // True if config has not been pushed to network stack. |
159 PrefChangeRegistrar proxy_prefs_; | 159 PrefChangeRegistrar proxy_prefs_; |
160 | 160 |
161 DISALLOW_COPY_AND_ASSIGN(PrefProxyConfigTrackerImpl); | 161 DISALLOW_COPY_AND_ASSIGN(PrefProxyConfigTrackerImpl); |
162 }; | 162 }; |
163 | 163 |
164 #endif // CHROME_BROWSER_NET_PREF_PROXY_CONFIG_TRACKER_IMPL_H_ | 164 #endif // CHROME_BROWSER_NET_PREF_PROXY_CONFIG_TRACKER_IMPL_H_ |
OLD | NEW |