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

Side by Side Diff: chrome/browser/extensions/extension_proxy_api.h

Issue 6468002: Implementation of getCurrentProxySettings for proxy settings API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/out/Debug
Patch Set: Removed todo and ask mpcomplete now. Created 9 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 CHROME_BROWSER_EXTENSIONS_EXTENSION_PROXY_API_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_PROXY_API_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PROXY_API_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PROXY_API_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "chrome/browser/extensions/extension_function.h" 10 #include "chrome/browser/extensions/extension_function.h"
11 11
12 namespace net {
13 class ProxyServer;
14 }
15
12 class DictionaryValue; 16 class DictionaryValue;
13 17
14 class ProxySettingsFunction : public SyncExtensionFunction { 18 class ProxySettingsFunction : public SyncExtensionFunction {
15 public: 19 public:
16 virtual ~ProxySettingsFunction() {} 20 virtual ~ProxySettingsFunction() {}
17 virtual bool RunImpl() = 0; 21 virtual bool RunImpl() = 0;
18 protected: 22 protected:
19 // Takes ownership of |pref_value|. 23 // Takes ownership of |pref_value|.
20 void ApplyPreference( 24 void ApplyPreference(
21 const char* pref_path, Value* pref_value, bool incognito); 25 const char* pref_path, Value* pref_value, bool incognito);
(...skipping 10 matching lines...) Expand all
32 36
33 class RemoveCustomProxySettingsFunction : public ProxySettingsFunction { 37 class RemoveCustomProxySettingsFunction : public ProxySettingsFunction {
34 public: 38 public:
35 virtual ~RemoveCustomProxySettingsFunction() {} 39 virtual ~RemoveCustomProxySettingsFunction() {}
36 virtual bool RunImpl(); 40 virtual bool RunImpl();
37 41
38 DECLARE_EXTENSION_FUNCTION_NAME( 42 DECLARE_EXTENSION_FUNCTION_NAME(
39 "experimental.proxy.removeCustomProxySettings") 43 "experimental.proxy.removeCustomProxySettings")
40 }; 44 };
41 45
46 class GetCurrentProxySettingsFunction : public ProxySettingsFunction {
47 public:
48 virtual ~GetCurrentProxySettingsFunction() {}
49 virtual bool RunImpl();
50
51 DECLARE_EXTENSION_FUNCTION_NAME(
52 "experimental.proxy.getCurrentProxySettings")
53 private:
54 // Convert the representation of a proxy configuration from the format
55 // that is stored in the pref stores to the format that is used by the API.
56 // See ProxyServer type defined in |experimental.proxy|.
57 bool ConvertToApiFormat(const DictionaryValue* proxy_prefs,
58 DictionaryValue* api_proxy_config) const;
59 bool ParseRules(const std::string& rules, DictionaryValue* out) const;
60 DictionaryValue* ConvertToDictionary(const net::ProxyServer& proxy) const;
61 };
62
42 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PROXY_API_H_ 63 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PROXY_API_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_function_dispatcher.cc ('k') | chrome/browser/extensions/extension_proxy_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698