Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(490)

Side by Side Diff: chrome/browser/net/proxy_policy_handler.h

Issue 1384463002: Componentize proxy_policy_handler from chrome/browser/net (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase and updated Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/net/OWNERS ('k') | chrome/browser/net/proxy_policy_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_NET_PROXY_POLICY_HANDLER_H_
6 #define CHROME_BROWSER_NET_PROXY_POLICY_HANDLER_H_
7
8 #include <string>
9
10 #include "base/basictypes.h"
11 #include "components/policy/core/browser/configuration_policy_handler.h"
12
13 namespace policy {
14
15 class ProxyMap;
16 class ProxyErrorMap;
17
18 // ConfigurationPolicyHandler for the proxy policies.
19 class ProxyPolicyHandler : public ConfigurationPolicyHandler {
20 public:
21 // Constants for the "Proxy Server Mode" defined in the policies.
22 // Note that these diverge from internal presentation defined in
23 // ProxyPrefs::ProxyMode for legacy reasons. The following four
24 // PolicyProxyModeType types were not very precise and had overlapping use
25 // cases.
26 enum ProxyModeType {
27 // Disable Proxy, connect directly.
28 PROXY_SERVER_MODE = 0,
29 // Auto detect proxy or use specific PAC script if given.
30 PROXY_AUTO_DETECT_PROXY_SERVER_MODE = 1,
31 // Use manually configured proxy servers (fixed servers).
32 PROXY_MANUALLY_CONFIGURED_PROXY_SERVER_MODE = 2,
33 // Use system proxy server.
34 PROXY_USE_SYSTEM_PROXY_SERVER_MODE = 3,
35
36 MODE_COUNT
37 };
38
39 ProxyPolicyHandler();
40 ~ProxyPolicyHandler() override;
41
42 // ConfigurationPolicyHandler methods:
43 bool CheckPolicySettings(const PolicyMap& policies,
44 PolicyErrorMap* errors) override;
45 void ApplyPolicySettings(const PolicyMap& policies,
46 PrefValueMap* prefs) override;
47
48 private:
49 const base::Value* GetProxyPolicyValue(const PolicyMap& policies,
50 const char* policy_name);
51
52 // Converts the deprecated ProxyServerMode policy value to a ProxyMode value
53 // and places the result in |mode_value|. Returns whether the conversion
54 // succeeded.
55 bool CheckProxyModeAndServerMode(const PolicyMap& policies,
56 PolicyErrorMap* errors,
57 std::string* mode_value);
58
59 DISALLOW_COPY_AND_ASSIGN(ProxyPolicyHandler);
60 };
61
62 } // namespace policy
63
64 #endif // CHROME_BROWSER_NET_PROXY_POLICY_HANDLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/net/OWNERS ('k') | chrome/browser/net/proxy_policy_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698