| 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 NET_PROXY_PROXY_CONFIG_SERVICE_MAC_H_ | 5 #ifndef NET_PROXY_PROXY_CONFIG_SERVICE_MAC_H_ |
| 6 #define NET_PROXY_PROXY_CONFIG_SERVICE_MAC_H_ | 6 #define NET_PROXY_PROXY_CONFIG_SERVICE_MAC_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" |
| 11 #include "base/observer_list.h" | 11 #include "base/observer_list.h" |
| 12 #include "net/base/network_config_watcher_mac.h" | 12 #include "net/base/network_config_watcher_mac.h" |
| 13 #include "net/proxy/proxy_config.h" | 13 #include "net/proxy/proxy_config.h" |
| 14 #include "net/proxy/proxy_config_service.h" | 14 #include "net/proxy/proxy_config_service.h" |
| 15 | 15 |
| 16 namespace net { | 16 namespace net { |
| 17 | 17 |
| 18 class ProxyConfigServiceMac : public ProxyConfigService { | 18 class ProxyConfigServiceMac : public ProxyConfigService { |
| 19 public: | 19 public: |
| 20 // Constructs a ProxyConfigService that watches the Mac OS system settings. | 20 // Constructs a ProxyConfigService that watches the Mac OS system settings. |
| 21 // This instance is expected to be operated and deleted on |io_loop| | 21 // This instance is expected to be operated and deleted on |io_loop| |
| 22 // (however it may be constructed from a different thread). | 22 // (however it may be constructed from a different thread). |
| 23 explicit ProxyConfigServiceMac(MessageLoop* io_loop); | 23 explicit ProxyConfigServiceMac(MessageLoop* io_loop); |
| 24 virtual ~ProxyConfigServiceMac(); | 24 virtual ~ProxyConfigServiceMac(); |
| 25 | 25 |
| 26 public: | 26 public: |
| 27 // ProxyConfigService implementation: | 27 // ProxyConfigService implementation: |
| 28 virtual void AddObserver(Observer* observer); | 28 virtual void AddObserver(Observer* observer); |
| 29 virtual void RemoveObserver(Observer* observer); | 29 virtual void RemoveObserver(Observer* observer); |
| 30 virtual bool GetLatestProxyConfig(ProxyConfig* config); | 30 virtual ConfigAvailability GetLatestProxyConfig(ProxyConfig* config); |
| 31 | 31 |
| 32 private: | 32 private: |
| 33 class Helper; | 33 class Helper; |
| 34 | 34 |
| 35 // Forwarder just exists to keep the NetworkConfigWatcherMac API out of | 35 // Forwarder just exists to keep the NetworkConfigWatcherMac API out of |
| 36 // ProxyConfigServiceMac's public API. | 36 // ProxyConfigServiceMac's public API. |
| 37 class Forwarder : public NetworkConfigWatcherMac::Delegate { | 37 class Forwarder : public NetworkConfigWatcherMac::Delegate { |
| 38 public: | 38 public: |
| 39 explicit Forwarder(ProxyConfigServiceMac* net_config_watcher) | 39 explicit Forwarder(ProxyConfigServiceMac* net_config_watcher) |
| 40 : net_config_watcher_(net_config_watcher) {} | 40 : net_config_watcher_(net_config_watcher) {} |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 | 72 |
| 73 // The thread that we expect to be operated on. | 73 // The thread that we expect to be operated on. |
| 74 MessageLoop* io_loop_; | 74 MessageLoop* io_loop_; |
| 75 | 75 |
| 76 DISALLOW_COPY_AND_ASSIGN(ProxyConfigServiceMac); | 76 DISALLOW_COPY_AND_ASSIGN(ProxyConfigServiceMac); |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 } // namespace net | 79 } // namespace net |
| 80 | 80 |
| 81 #endif // NET_PROXY_PROXY_CONFIG_SERVICE_MAC_H_ | 81 #endif // NET_PROXY_PROXY_CONFIG_SERVICE_MAC_H_ |
| OLD | NEW |