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 COMPONENTS_PROXY_CONFIG_PREF_PROXY_CONFIG_TRACKER_H_ | 5 #ifndef COMPONENTS_PROXY_CONFIG_PREF_PROXY_CONFIG_TRACKER_H_ |
6 #define COMPONENTS_PROXY_CONFIG_PREF_PROXY_CONFIG_TRACKER_H_ | 6 #define COMPONENTS_PROXY_CONFIG_PREF_PROXY_CONFIG_TRACKER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 public: | 22 public: |
23 PrefProxyConfigTracker(); | 23 PrefProxyConfigTracker(); |
24 virtual ~PrefProxyConfigTracker(); | 24 virtual ~PrefProxyConfigTracker(); |
25 | 25 |
26 // Creates a net::ProxyConfigService and keeps a pointer to it. After this | 26 // Creates a net::ProxyConfigService and keeps a pointer to it. After this |
27 // call, this tracker forwards any changes of proxy preferences to the created | 27 // call, this tracker forwards any changes of proxy preferences to the created |
28 // ProxyConfigService. The returned ProxyConfigService must not be deleted | 28 // ProxyConfigService. The returned ProxyConfigService must not be deleted |
29 // before DetachFromPrefService was called. Takes ownership of the passed | 29 // before DetachFromPrefService was called. Takes ownership of the passed |
30 // |base_service|, which can be NULL. This |base_service| provides the proxy | 30 // |base_service|, which can be NULL. This |base_service| provides the proxy |
31 // settings of the OS (except of ChromeOS). This must be called on the | 31 // settings of the OS (except of ChromeOS). This must be called on the |
32 // UI thread. | 32 // UI thread. May only be called once on a PrefProxyConfigTracker. |
33 virtual std::unique_ptr<net::ProxyConfigService> | 33 virtual std::unique_ptr<net::ProxyConfigService> |
34 CreateTrackingProxyConfigService( | 34 CreateTrackingProxyConfigService( |
35 std::unique_ptr<net::ProxyConfigService> base_service) = 0; | 35 std::unique_ptr<net::ProxyConfigService> base_service) = 0; |
36 | 36 |
37 // Releases the PrefService passed upon construction and the |base_service| | 37 // Releases the PrefService passed upon construction and the |base_service| |
38 // passed to CreateTrackingProxyConfigService. This must be called on the UI | 38 // passed to CreateTrackingProxyConfigService. This must be called on the UI |
39 // thread. | 39 // thread. |
40 virtual void DetachFromPrefService() = 0; | 40 virtual void DetachFromPrefService() = 0; |
41 | 41 |
42 private: | 42 private: |
43 DISALLOW_COPY_AND_ASSIGN(PrefProxyConfigTracker); | 43 DISALLOW_COPY_AND_ASSIGN(PrefProxyConfigTracker); |
44 }; | 44 }; |
45 | 45 |
46 #endif // COMPONENTS_PROXY_CONFIG_PREF_PROXY_CONFIG_TRACKER_H_ | 46 #endif // COMPONENTS_PROXY_CONFIG_PREF_PROXY_CONFIG_TRACKER_H_ |
OLD | NEW |