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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_proxy_api.h
diff --git a/chrome/browser/extensions/extension_proxy_api.h b/chrome/browser/extensions/extension_proxy_api.h
index ab6f9c9351ed29afae9ca2cd05499dd45d0f2a22..6c9d3bdc2eb5d48388565d6dabc92103abf79fc0 100644
--- a/chrome/browser/extensions/extension_proxy_api.h
+++ b/chrome/browser/extensions/extension_proxy_api.h
@@ -9,6 +9,10 @@
#include "chrome/browser/extensions/extension_function.h"
+namespace net {
+class ProxyServer;
+}
+
class DictionaryValue;
class ProxySettingsFunction : public SyncExtensionFunction {
@@ -39,4 +43,21 @@ class RemoveCustomProxySettingsFunction : public ProxySettingsFunction {
"experimental.proxy.removeCustomProxySettings")
};
+class GetCurrentProxySettingsFunction : public ProxySettingsFunction {
+ public:
+ virtual ~GetCurrentProxySettingsFunction() {}
+ virtual bool RunImpl();
+
+ DECLARE_EXTENSION_FUNCTION_NAME(
+ "experimental.proxy.getCurrentProxySettings")
+ private:
+ // Convert the representation of a proxy configuration from the format
+ // that is stored in the pref stores to the format that is used by the API.
+ // See ProxyServer type defined in |experimental.proxy|.
+ bool ConvertToApiFormat(const DictionaryValue* proxy_prefs,
+ DictionaryValue* api_proxy_config) const;
+ bool ParseRules(const std::string& rules, DictionaryValue* out) const;
+ DictionaryValue* ConvertToDictionary(const net::ProxyServer& proxy) const;
+};
+
#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PROXY_API_H_
« 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