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

Side by Side Diff: chrome/browser/prefs/proxy_config_dictionary.h

Issue 1221033002: Add proxy_config component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update copyrights Created 5 years, 5 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_PREFS_PROXY_CONFIG_DICTIONARY_H_
6 #define CHROME_BROWSER_PREFS_PROXY_CONFIG_DICTIONARY_H_
7
8 #include <string>
9
10 #include "base/basictypes.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "chrome/browser/prefs/proxy_prefs.h"
13
14 namespace base {
15 class DictionaryValue;
16 }
17
18 // Factory and wrapper for proxy config dictionaries that are stored
19 // in the user preferences. The dictionary has the following structure:
20 // {
21 // mode: string,
22 // server: string,
23 // pac_url: string,
24 // bypass_list: string
25 // }
26 // See proxy_config_dictionary.cc for the structure of the respective strings.
27 class ProxyConfigDictionary {
28 public:
29 // Creates a deep copy of |dict| and leaves ownership to caller.
30 explicit ProxyConfigDictionary(const base::DictionaryValue* dict);
31 ~ProxyConfigDictionary();
32
33 bool GetMode(ProxyPrefs::ProxyMode* out) const;
34 bool GetPacUrl(std::string* out) const;
35 bool GetPacMandatory(bool* out) const;
36 bool GetProxyServer(std::string* out) const;
37 bool GetBypassList(std::string* out) const;
38 bool HasBypassList() const;
39
40 const base::DictionaryValue& GetDictionary() const;
41
42 static base::DictionaryValue* CreateDirect();
43 static base::DictionaryValue* CreateAutoDetect();
44 static base::DictionaryValue* CreatePacScript(const std::string& pac_url,
45 bool pac_mandatory);
46 static base::DictionaryValue* CreateFixedServers(
47 const std::string& proxy_server,
48 const std::string& bypass_list);
49 static base::DictionaryValue* CreateSystem();
50 private:
51 static base::DictionaryValue* CreateDictionary(
52 ProxyPrefs::ProxyMode mode,
53 const std::string& pac_url,
54 bool pac_mandatory,
55 const std::string& proxy_server,
56 const std::string& bypass_list);
57
58 scoped_ptr<base::DictionaryValue> dict_;
59
60 DISALLOW_COPY_AND_ASSIGN(ProxyConfigDictionary);
61 };
62
63 #endif // CHROME_BROWSER_PREFS_PROXY_CONFIG_DICTIONARY_H_
OLDNEW
« no previous file with comments | « chrome/browser/prefs/command_line_pref_store_unittest.cc ('k') | chrome/browser/prefs/proxy_config_dictionary.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698