| OLD | NEW |
| 1 // Copyright (c) 2010 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_CHROMEOS_PROXY_CONFIG_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_PROXY_CONFIG_SERVICE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_PROXY_CONFIG_SERVICE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_PROXY_CONFIG_SERVICE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "chrome/browser/chromeos/proxy_config_service_impl.h" | 9 #include "chrome/browser/chromeos/proxy_config_service_impl.h" |
| 10 | 10 |
| 11 namespace chromeos { | 11 namespace chromeos { |
| 12 | 12 |
| 13 // Wrapper class for the RefCountedThreadSafe chromeos::ProxyConfigServiceImpl | 13 // Wrapper class for the RefCountedThreadSafe chromeos::ProxyConfigServiceImpl |
| 14 // that forwards net::ProxyConfigService interface to the actual implementation, | 14 // that forwards net::ProxyConfigService interface to the actual implementation, |
| 15 // instantiated in | 15 // instantiated in ProfileIOData::CreateProxyConfigService. |
| 16 // chrome/browser/net/chrome_url_request_context.cc::CreateProxyConfigService. | |
| 17 class ProxyConfigService : public net::ProxyConfigService { | 16 class ProxyConfigService : public net::ProxyConfigService { |
| 18 public: | 17 public: |
| 19 explicit ProxyConfigService(const scoped_refptr<ProxyConfigServiceImpl>& impl) | 18 explicit ProxyConfigService(const scoped_refptr<ProxyConfigServiceImpl>& impl) |
| 20 : impl_(impl) {} | 19 : impl_(impl) {} |
| 21 virtual ~ProxyConfigService() {} | 20 virtual ~ProxyConfigService() {} |
| 22 | 21 |
| 23 // ProxyConfigService methods. Called from IO thread. | 22 // ProxyConfigService methods. Called from IO thread. |
| 24 virtual void AddObserver(Observer* observer) { | 23 virtual void AddObserver(Observer* observer) { |
| 25 impl_->AddObserver(observer); | 24 impl_->AddObserver(observer); |
| 26 } | 25 } |
| 27 virtual void RemoveObserver(Observer* observer) { | 26 virtual void RemoveObserver(Observer* observer) { |
| 28 impl_->RemoveObserver(observer); | 27 impl_->RemoveObserver(observer); |
| 29 } | 28 } |
| 30 virtual bool GetLatestProxyConfig(net::ProxyConfig* config) { | 29 virtual ConfigAvailability GetLatestProxyConfig(net::ProxyConfig* config) { |
| 31 return impl_->IOGetProxyConfig(config); | 30 return impl_->IOGetProxyConfig(config); |
| 32 } | 31 } |
| 33 | 32 |
| 34 private: | 33 private: |
| 35 scoped_refptr<ProxyConfigServiceImpl> impl_; | 34 scoped_refptr<ProxyConfigServiceImpl> impl_; |
| 36 | 35 |
| 37 DISALLOW_COPY_AND_ASSIGN(ProxyConfigService); | 36 DISALLOW_COPY_AND_ASSIGN(ProxyConfigService); |
| 38 }; | 37 }; |
| 39 | 38 |
| 40 } // namespace chromeos | 39 } // namespace chromeos |
| 41 | 40 |
| 42 #endif // CHROME_BROWSER_CHROMEOS_PROXY_CONFIG_SERVICE_H_ | 41 #endif // CHROME_BROWSER_CHROMEOS_PROXY_CONFIG_SERVICE_H_ |
| OLD | NEW |