summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_proxy_api.h
diff options
context:
space:
mode:
authorpam@chromium.org <pam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-04 09:13:44 +0000
committerpam@chromium.org <pam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-04 09:13:44 +0000
commita9c23a5d29f9aab00fd936801e0dbbed91c18796 (patch)
treeed72849a3f2b0701ce08c429fea2c6f1936929ce /chrome/browser/extensions/extension_proxy_api.h
parenta06f7c07423533d4a6ba654be81ce70e82f0449d (diff)
downloadchromium_src-a9c23a5d29f9aab00fd936801e0dbbed91c18796.zip
chromium_src-a9c23a5d29f9aab00fd936801e0dbbed91c18796.tar.gz
chromium_src-a9c23a5d29f9aab00fd936801e0dbbed91c18796.tar.bz2
First stage of proxy extension API.
Adds a basic API that will cover the features available with the --proxy-server command-line switch, once the underlying proxy config is rewritten to actually access the pref dynamically rather than only ever loading a proxy config on startup. BUG=48930 TEST=covered by browser_tests (ExtensionApiTest.Proxy*) Review URL: http://codereview.chromium.org/3074013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54882 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_proxy_api.h')
-rw-r--r--chrome/browser/extensions/extension_proxy_api.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extension_proxy_api.h b/chrome/browser/extensions/extension_proxy_api.h
new file mode 100644
index 0000000..1bc7ae3
--- /dev/null
+++ b/chrome/browser/extensions/extension_proxy_api.h
@@ -0,0 +1,37 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_PROXY_API_H_
+#define CHROME_BROWSER_EXTENSIONS_EXTENSION_PROXY_API_H_
+
+#include <string>
+
+#include "chrome/browser/extensions/extension_function.h"
+
+class DictionaryValue;
+
+class UseCustomProxySettingsFunction : public SyncExtensionFunction {
+ public:
+ ~UseCustomProxySettingsFunction() {}
+ virtual bool RunImpl();
+
+ DECLARE_EXTENSION_FUNCTION_NAME("experimental.proxy.useCustomProxySettings")
+
+ private:
+ struct ProxyServer {
+ enum {
+ INVALID_PORT = -1
+ };
+ ProxyServer() : scheme("http"), host(""), port(INVALID_PORT) {}
+
+ // The scheme of the proxy URI itself.
+ std::string scheme;
+ std::string host;
+ int port;
+ };
+
+ bool GetProxyServer(const DictionaryValue* dict, ProxyServer* proxy_server);
+};
+
+#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PROXY_API_H_