| 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_NET_PREF_PROXY_CONFIG_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_NET_PREF_PROXY_CONFIG_SERVICE_H_ |
| 6 #define CHROME_BROWSER_NET_PREF_PROXY_CONFIG_SERVICE_H_ | 6 #define CHROME_BROWSER_NET_PREF_PROXY_CONFIG_SERVICE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 | 56 |
| 57 // Notifies the tracker that the pref service passed upon construction is | 57 // Notifies the tracker that the pref service passed upon construction is |
| 58 // about to go away. This must be called from the UI thread. | 58 // about to go away. This must be called from the UI thread. |
| 59 void DetachFromPrefService(); | 59 void DetachFromPrefService(); |
| 60 | 60 |
| 61 private: | 61 private: |
| 62 friend class base::RefCountedThreadSafe<PrefProxyConfigTracker>; | 62 friend class base::RefCountedThreadSafe<PrefProxyConfigTracker>; |
| 63 virtual ~PrefProxyConfigTracker(); | 63 virtual ~PrefProxyConfigTracker(); |
| 64 | 64 |
| 65 // NotificationObserver implementation: | 65 // NotificationObserver implementation: |
| 66 virtual void Observe(NotificationType type, | 66 virtual void Observe(int type, |
| 67 const NotificationSource& source, | 67 const NotificationSource& source, |
| 68 const NotificationDetails& details); | 68 const NotificationDetails& details); |
| 69 | 69 |
| 70 // Install a new configuration. This is invoked on the IO thread to update | 70 // Install a new configuration. This is invoked on the IO thread to update |
| 71 // the internal state after handling a pref change on the UI thread. | 71 // the internal state after handling a pref change on the UI thread. |
| 72 // |config_state| indicates the new state we're switching to, and |config| is | 72 // |config_state| indicates the new state we're switching to, and |config| is |
| 73 // the new preference-based proxy configuration if |config_state| is different | 73 // the new preference-based proxy configuration if |config_state| is different |
| 74 // from CONFIG_UNSET. | 74 // from CONFIG_UNSET. |
| 75 void InstallProxyConfig(const net::ProxyConfig& config, ConfigState state); | 75 void InstallProxyConfig(const net::ProxyConfig& config, ConfigState state); |
| 76 | 76 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 ObserverList<net::ProxyConfigService::Observer, true> observers_; | 139 ObserverList<net::ProxyConfigService::Observer, true> observers_; |
| 140 scoped_refptr<PrefProxyConfigTracker> pref_config_tracker_; | 140 scoped_refptr<PrefProxyConfigTracker> pref_config_tracker_; |
| 141 | 141 |
| 142 // Indicates whether the base service and tracker registrations are done. | 142 // Indicates whether the base service and tracker registrations are done. |
| 143 bool registered_observers_; | 143 bool registered_observers_; |
| 144 | 144 |
| 145 DISALLOW_COPY_AND_ASSIGN(PrefProxyConfigService); | 145 DISALLOW_COPY_AND_ASSIGN(PrefProxyConfigService); |
| 146 }; | 146 }; |
| 147 | 147 |
| 148 #endif // CHROME_BROWSER_NET_PREF_PROXY_CONFIG_SERVICE_H_ | 148 #endif // CHROME_BROWSER_NET_PREF_PROXY_CONFIG_SERVICE_H_ |
| OLD | NEW |