summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/proxy_config_service.h
blob: cabf8bf8db288388f66f876a9d332b39f975e5d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_CHROMEOS_PROXY_CONFIG_SERVICE_H_
#define CHROME_BROWSER_CHROMEOS_PROXY_CONFIG_SERVICE_H_
#pragma once

#include "chrome/browser/chromeos/proxy_config_service_impl.h"

namespace chromeos {

// Wrapper class for the RefCountedThreadSafe chromeos::ProxyConfigServiceImpl
// that forwards net::ProxyConfigService interface to the actual implementation,
// instantiated in
// chrome/browser/net/chrome_url_request_context.cc::CreateProxyConfigService.
class ProxyConfigService : public net::ProxyConfigService {
 public:
  explicit ProxyConfigService(const scoped_refptr<ProxyConfigServiceImpl>& impl)
      : impl_(impl) {}
  virtual ~ProxyConfigService() {}

  // ProxyConfigService methods.  Called from IO thread.
  virtual void AddObserver(Observer* observer) {
    impl_->AddObserver(observer);
  }
  virtual void RemoveObserver(Observer* observer) {
    impl_->RemoveObserver(observer);
  }
  virtual bool GetLatestProxyConfig(net::ProxyConfig* config) {
    return impl_->IOGetProxyConfig(config);
  }

 private:
  scoped_refptr<ProxyConfigServiceImpl> impl_;

  DISALLOW_COPY_AND_ASSIGN(ProxyConfigService);
};

}  // namespace chromeos

#endif  // CHROME_BROWSER_CHROMEOS_PROXY_CONFIG_SERVICE_H_