From 63a80512c10fd9a7c836ec93895c30000fa31c8e Mon Sep 17 00:00:00 2001
From: "battre@chromium.org"
Date: Fri, 25 Feb 2011 07:02:07 +0000
Subject: Remove RemoveCustomProxySettingsFunction as it is substituted by
clear of preferences api
BUG=73387
TEST=Execute Proxy Settings API tests (browser_tests --gtest_filter="ProxySettings*"
Review URL: http://codereview.chromium.org/6574038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76031 0039d316-1c4b-4281-b951-d872f2087c98
---
.../extensions/extension_function_dispatcher.cc | 1 -
chrome/browser/extensions/extension_proxy_api.cc | 20 ---
chrome/browser/extensions/extension_proxy_api.h | 11 --
chrome/common/extensions/api/extension_api.json | 15 ---
.../extensions/docs/experimental.extension.html | 135 ++++++++++++++++++++-
.../common/extensions/docs/experimental.proxy.html | 101 +++------------
.../api_test/proxy/individual_remove/test.js | 4 +-
7 files changed, 156 insertions(+), 131 deletions(-)
(limited to 'chrome')
diff --git a/chrome/browser/extensions/extension_function_dispatcher.cc b/chrome/browser/extensions/extension_function_dispatcher.cc
index bdd1555..29d2a3a 100644
--- a/chrome/browser/extensions/extension_function_dispatcher.cc
+++ b/chrome/browser/extensions/extension_function_dispatcher.cc
@@ -260,7 +260,6 @@ void FactoryRegistry::ResetFunctions() {
// Proxies.
RegisterFunction();
- RegisterFunction();
RegisterFunction();
// Sidebar.
diff --git a/chrome/browser/extensions/extension_proxy_api.cc b/chrome/browser/extensions/extension_proxy_api.cc
index 60a2d69..bc439eb 100644
--- a/chrome/browser/extensions/extension_proxy_api.cc
+++ b/chrome/browser/extensions/extension_proxy_api.cc
@@ -390,26 +390,6 @@ bool SetProxySettingsFunction::RunImpl() {
return SetPreferenceFunction::RunImpl();
}
-void RemoveCustomProxySettingsFunction::RemovePreference(const char* pref_path,
- bool incognito) {
- Profile* use_profile = profile();
- if (use_profile->IsOffTheRecord())
- use_profile = use_profile->GetOriginalProfile();
-
- use_profile->GetExtensionService()->extension_prefs()->
- RemoveExtensionControlledPref(extension_id(), pref_path, incognito);
-}
-
-bool RemoveCustomProxySettingsFunction::RunImpl() {
- bool incognito = false;
- if (HasOptionalArgument(0)) {
- EXTENSION_FUNCTION_VALIDATE(args_->GetBoolean(0, &incognito));
- }
-
- RemovePreference(prefs::kProxy, incognito);
- return true;
-}
-
bool GetProxySettingsFunction::RunImpl() {
if (!GetPreferenceFunction::RunImpl())
return false;
diff --git a/chrome/browser/extensions/extension_proxy_api.h b/chrome/browser/extensions/extension_proxy_api.h
index 1dbb042..cd21a00 100644
--- a/chrome/browser/extensions/extension_proxy_api.h
+++ b/chrome/browser/extensions/extension_proxy_api.h
@@ -66,17 +66,6 @@ class SetProxySettingsFunction : public SetPreferenceFunction {
bool GetBypassList(DictionaryValue* proxy_rules, std::string* out);
};
-class RemoveCustomProxySettingsFunction : public SyncExtensionFunction {
- public:
- virtual ~RemoveCustomProxySettingsFunction() {}
- virtual bool RunImpl();
-
- DECLARE_EXTENSION_FUNCTION_NAME(
- "experimental.proxy.removeCustomProxySettings")
- private:
- void RemovePreference(const char* pref_path, bool incognito);
-};
-
class GetProxySettingsFunction : public GetPreferenceFunction {
public:
virtual ~GetProxySettingsFunction() {}
diff --git a/chrome/common/extensions/api/extension_api.json b/chrome/common/extensions/api/extension_api.json
index 1a2aa46..c3f47a0 100644
--- a/chrome/common/extensions/api/extension_api.json
+++ b/chrome/common/extensions/api/extension_api.json
@@ -3754,21 +3754,6 @@
}
}
],
- "functions": [
- {
- "name": "removeCustomProxySettings",
- "type": "function",
- "description": "Remove a custom proxy set by the current extension. This is the inverse of useCustomProxySettings().",
- "parameters": [
- {
- "name": "incognito",
- "type": "boolean",
- "description": "See incognito parameter of useCustomProxySettings().",
- "optional": true
- }
- ]
- }
- ],
"properties": {
"settings": {
"$ref": "Preference",
diff --git a/chrome/common/extensions/docs/experimental.extension.html b/chrome/common/extensions/docs/experimental.extension.html
index 35f4380..4d203ae 100644
--- a/chrome/common/extensions/docs/experimental.extension.html
+++ b/chrome/common/extensions/docs/experimental.extension.html
@@ -1026,11 +1026,56 @@
- function(any value) {...};
+ function(object details) {...};
-
+ details
+
+
+
+
+ (
+
optional
+
enumerated
+
+
+ Type
+
+
+
+ array of
+
+ object
+
+
+
+ )
+
+
+
+
+
-
+ Undocumented.
+
+
- Details of the currently effective preference value.
+
-
+ This parameter was added in version
+ .
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ minimum_chrome_version
+ can ensure that your extension won't be run in an earlier browser version.
+
+
+
+
-
+
+
+
+
-
value
@@ -1096,6 +1141,94 @@
+
+
+
-
+ levelOfControl
+
+
+
+
+ (
+
optional
+
enumerated
+
+
+ Type
+
+
+
+ array of
+
+ string
+ ["NotControllable", "ControlledByOtherExtensions", "ControllableByThisExtension", "ControlledByThisExtension"]
+
+
+ )
+
+
+
+
+
-
+ Undocumented.
+
+
- One of
NotControllable = cannot be controlled by any extension
ControlledByOtherExtensions = controlled by extensions with higher precedence
ControllableByThisExtension = can be controlled by this extension
ControlledByThisExtension = controlled by this extension
+
-
+ This parameter was added in version
+ .
+ You must omit this parameter in earlier versions,
+ and you may omit it in any version. If you require this
+ parameter, the manifest key
+ minimum_chrome_version
+ can ensure that your extension won't be run in an earlier browser version.
+
+
+
+
-
+
+
+
+
+
+
+
-
+
+
+
+
+
-
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
-
+
+
+
+
+
-
+
+
+
+
diff --git a/chrome/common/extensions/docs/experimental.proxy.html b/chrome/common/extensions/docs/experimental.proxy.html
index e0d3687..485e607 100644
--- a/chrome/common/extensions/docs/experimental.proxy.html
+++ b/chrome/common/extensions/docs/experimental.proxy.html
@@ -303,11 +303,11 @@
-
- Methods
+
+ Methods
-
- removeCustomProxySettings
+ methodName
@@ -694,109 +694,46 @@ element.
-
-
+
+
Methods
-
-
removeCustomProxySettings
+
+
method name
-
void
+
void
- chrome.experimental.proxy.removeCustomProxySettings(, boolean
- incognito)
+
chrome.module.methodName(
,
+ )
-
Undocumented.
-
Remove a custom proxy set by the current extension. This is the inverse of useCustomProxySettings().
+
Undocumented.
+
+ A description from the json schema def of the function goes here.
+
Parameters
-
-
- incognito
-
-
-
-
- (
-
optional
-
enumerated
-
-
- Type
-
-
-
- array of
-
- boolean
-
-
-
- )
-
-
-
-
-
-
- Undocumented.
-
-
- See incognito parameter of useCustomProxySettings().
-
-
- This parameter was added in version
- .
- You must omit this parameter in earlier versions,
- and you may omit it in any version. If you require this
- parameter, the manifest key
- minimum_chrome_version
- can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
Returns
+
Returns
-
+
-
+
Callback function
@@ -820,7 +757,7 @@ element.
-
+
This function was added in version .
If you require this function, the manifest key
minimum_chrome_version
diff --git a/chrome/test/data/extensions/api_test/proxy/individual_remove/test.js b/chrome/test/data/extensions/api_test/proxy/individual_remove/test.js
index e9c3a39..d673c0f 100644
--- a/chrome/test/data/extensions/api_test/proxy/individual_remove/test.js
+++ b/chrome/test/data/extensions/api_test/proxy/individual_remove/test.js
@@ -35,6 +35,8 @@ chrome.test.runTests([
chrome.experimental.proxy.settings.set(
{'value': config, 'incognito': false},
chrome.test.callbackPass());
- chrome.experimental.proxy.removeCustomProxySettings(false);
+ chrome.experimental.proxy.settings.clear(
+ {'incognito': false},
+ chrome.test.callbackPass());
}
]);
--
cgit v1.1