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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 bool registered_observer_; | 74 bool registered_observer_; |
75 | 75 |
76 DISALLOW_COPY_AND_ASSIGN(ChromeProxyConfigService); | 76 DISALLOW_COPY_AND_ASSIGN(ChromeProxyConfigService); |
77 }; | 77 }; |
78 | 78 |
79 // A class that tracks proxy preferences. It translates the configuration | 79 // A class that tracks proxy preferences. It translates the configuration |
80 // to net::ProxyConfig and pushes the result over to the IO thread for | 80 // to net::ProxyConfig and pushes the result over to the IO thread for |
81 // ChromeProxyConfigService::UpdateProxyConfig to use. | 81 // ChromeProxyConfigService::UpdateProxyConfig to use. |
82 class PrefProxyConfigTrackerImpl : public PrefProxyConfigTracker { | 82 class PrefProxyConfigTrackerImpl : public PrefProxyConfigTracker { |
83 public: | 83 public: |
| 84 // Enum values that can be reported for the |
| 85 // Net.PrefProxyConfig.GooglezipProxyRemovalResult histogram. These values |
| 86 // must be kept in sync with their counterparts in histograms.xml. Visible |
| 87 // here for testing purposes. |
| 88 enum GooglezipProxyRemovalResult { |
| 89 GOOGLEZIP_PROXY_REMOVAL_RESULT_NOT_FOUND = 0, |
| 90 GOOGLEZIP_PROXY_REMOVAL_RESULT_FOUND_AND_REMOVED, |
| 91 GOOGLEZIP_PROXY_REMOVAL_RESULT_MAX |
| 92 }; |
| 93 |
84 explicit PrefProxyConfigTrackerImpl(PrefService* pref_service); | 94 explicit PrefProxyConfigTrackerImpl(PrefService* pref_service); |
85 ~PrefProxyConfigTrackerImpl() override; | 95 ~PrefProxyConfigTrackerImpl() override; |
86 | 96 |
87 // PrefProxyConfigTracker implementation: | 97 // PrefProxyConfigTracker implementation: |
88 scoped_ptr<net::ProxyConfigService> CreateTrackingProxyConfigService( | 98 scoped_ptr<net::ProxyConfigService> CreateTrackingProxyConfigService( |
89 scoped_ptr<net::ProxyConfigService> base_service) override; | 99 scoped_ptr<net::ProxyConfigService> base_service) override; |
90 | 100 |
91 // Notifies the tracker that the pref service passed upon construction is | 101 // Notifies the tracker that the pref service passed upon construction is |
92 // about to go away. This must be called from the UI thread. | 102 // about to go away. This must be called from the UI thread. |
93 void DetachFromPrefService() override; | 103 void DetachFromPrefService() override; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 | 166 |
157 PrefService* pref_service_; | 167 PrefService* pref_service_; |
158 ChromeProxyConfigService* chrome_proxy_config_service_; // Weak ptr. | 168 ChromeProxyConfigService* chrome_proxy_config_service_; // Weak ptr. |
159 bool update_pending_; // True if config has not been pushed to network stack. | 169 bool update_pending_; // True if config has not been pushed to network stack. |
160 PrefChangeRegistrar proxy_prefs_; | 170 PrefChangeRegistrar proxy_prefs_; |
161 | 171 |
162 DISALLOW_COPY_AND_ASSIGN(PrefProxyConfigTrackerImpl); | 172 DISALLOW_COPY_AND_ASSIGN(PrefProxyConfigTrackerImpl); |
163 }; | 173 }; |
164 | 174 |
165 #endif // CHROME_BROWSER_NET_PREF_PROXY_CONFIG_TRACKER_IMPL_H_ | 175 #endif // CHROME_BROWSER_NET_PREF_PROXY_CONFIG_TRACKER_IMPL_H_ |
OLD | NEW |