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

Side by Side Diff: chromeos/network/proxy/ui_proxy_config.h

Issue 2785883003: Use unique_ptr<DictionaryValue> in ProxyConfigDictionary (Closed)
Patch Set: Fix compilation Created 3 years, 8 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 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 CHROMEOS_NETWORK_PROXY_UI_PROXY_CONFIG_H_ 5 #ifndef CHROMEOS_NETWORK_PROXY_UI_PROXY_CONFIG_H_
6 #define CHROMEOS_NETWORK_PROXY_UI_PROXY_CONFIG_H_ 6 #define CHROMEOS_NETWORK_PROXY_UI_PROXY_CONFIG_H_
7 7
8 #include <memory>
8 #include <string> 9 #include <string>
9 10
10 #include "chromeos/chromeos_export.h" 11 #include "chromeos/chromeos_export.h"
11 #include "components/proxy_config/proxy_prefs.h" 12 #include "components/proxy_config/proxy_prefs.h"
12 #include "net/proxy/proxy_bypass_rules.h" 13 #include "net/proxy/proxy_bypass_rules.h"
13 #include "net/proxy/proxy_server.h" 14 #include "net/proxy/proxy_server.h"
14 #include "url/gurl.h" 15 #include "url/gurl.h"
15 16
16 namespace base { 17 namespace base {
17 class DictionaryValue; 18 class DictionaryValue;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 const net::ProxyServer& server); 68 const net::ProxyServer& server);
68 69
69 // Only valid for MODE_SINGLE_PROXY or MODE_PROXY_PER_SCHEME. 70 // Only valid for MODE_SINGLE_PROXY or MODE_PROXY_PER_SCHEME.
70 void SetBypassRules(const net::ProxyBypassRules& rules); 71 void SetBypassRules(const net::ProxyBypassRules& rules);
71 72
72 // Converts net::ProxyConfig to |this|. 73 // Converts net::ProxyConfig to |this|.
73 bool FromNetProxyConfig(const net::ProxyConfig& net_config); 74 bool FromNetProxyConfig(const net::ProxyConfig& net_config);
74 75
75 // Converts |this| to Dictionary of ProxyConfigDictionary format (which 76 // Converts |this| to Dictionary of ProxyConfigDictionary format (which
76 // is the same format used by prefs). 77 // is the same format used by prefs).
77 base::DictionaryValue* ToPrefProxyConfig() const; 78 std::unique_ptr<base::DictionaryValue> ToPrefProxyConfig() const;
78 79
79 // Map |scheme| (one of "http", "https", "ftp" or "socks") to the correct 80 // Map |scheme| (one of "http", "https", "ftp" or "socks") to the correct
80 // ManualProxy. Returns NULL if scheme is invalid. 81 // ManualProxy. Returns NULL if scheme is invalid.
81 ManualProxy* MapSchemeToProxy(const std::string& scheme); 82 ManualProxy* MapSchemeToProxy(const std::string& scheme);
82 83
83 Mode mode; 84 Mode mode;
84 85
85 ProxyPrefs::ConfigState state; 86 ProxyPrefs::ConfigState state;
86 87
87 // True if user can modify proxy settings via UI. 88 // True if user can modify proxy settings via UI.
(...skipping 15 matching lines...) Expand all
103 // Set if mode is MODE_PROXY_PER_SCHEME and has socks proxy. 104 // Set if mode is MODE_PROXY_PER_SCHEME and has socks proxy.
104 ManualProxy socks_proxy; 105 ManualProxy socks_proxy;
105 106
106 // Exceptions for when not to use a proxy. 107 // Exceptions for when not to use a proxy.
107 net::ProxyBypassRules bypass_rules; 108 net::ProxyBypassRules bypass_rules;
108 }; 109 };
109 110
110 } // namespace chromeos 111 } // namespace chromeos
111 112
112 #endif // CHROMEOS_NETWORK_PROXY_UI_PROXY_CONFIG_H_ 113 #endif // CHROMEOS_NETWORK_PROXY_UI_PROXY_CONFIG_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698