This repository has been archived by the owner on Apr 16, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
cnet_proxy_service.h
46 lines (35 loc) · 1.46 KB
/
cnet_proxy_service.h
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
43
44
45
46
// Copyright 2014, Yahoo! Inc.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef YAHOO_CNET_CNET_PROXY_SERVICE_H_
#define YAHOO_CNET_CNET_PROXY_SERVICE_H_
#include "net/proxy/proxy_service.h"
namespace cnet {
class ProxyConfigService : public net::ProxyConfigService,
public net::ProxyConfigService::Observer {
public:
ProxyConfigService();
virtual ~ProxyConfigService();
void ActivateSystemProxyService(net::ProxyConfigService*
system_proxy_service);
void SetProxyConfig(const std::string& rules);
// net::ProxyConfigService methods
virtual void AddObserver(net::ProxyConfigService::Observer* observer)
override;
virtual void RemoveObserver(net::ProxyConfigService::Observer* observer)
override;
virtual net::ProxyConfigService::ConfigAvailability
GetLatestProxyConfig(net::ProxyConfig* config) override;
// net::ProxyConfigService::Observer method
virtual void OnProxyConfigChanged(const net::ProxyConfig& config,
net::ProxyConfigService::ConfigAvailability availability) override;
private:
net::ProxyConfigService::ConfigAvailability status_;
bool is_manual_;
ObserverList<net::ProxyConfigService::Observer> observers_;
scoped_ptr<net::ProxyConfig> config_;
scoped_ptr<net::ProxyConfigService> system_proxy_service_;
base::ThreadChecker thread_checker_;
};
} // namespace cnet
#endif // YAHOO_CNET_CNET_PROXY_SERVICE_H_