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

Unified Diff: chrome/common/extensions/docs/examples/extensions/proxy_configuration/proxy_form_controller.js

Issue 6990054: Disable setting incognito prefs for extensions for now. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 'Effective' is gone Created 9 years, 7 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/common/extensions/docs/examples/extensions/proxy_configuration/proxy_form_controller.js
diff --git a/chrome/common/extensions/docs/examples/extensions/proxy_configuration/proxy_form_controller.js b/chrome/common/extensions/docs/examples/extensions/proxy_configuration/proxy_form_controller.js
index 796d7b091efafcaafbe43532593185076c02a5d7..3350cf34a51ecce0c29ab49a5591024553e27f51 100644
--- a/chrome/common/extensions/docs/examples/extensions/proxy_configuration/proxy_form_controller.js
+++ b/chrome/common/extensions/docs/examples/extensions/proxy_configuration/proxy_form_controller.js
@@ -100,7 +100,9 @@ ProxyFormController.WrappedProxyConfig;
* @static
*/
ProxyFormController.getPersistedSettings = function() {
- var result = JSON.parse(window.localStorage['proxyConfig']);
+ var result = null;
+ if (window.localStorage['proxyConfig'] !== undefined)
+ result = JSON.parse(window.localStorage['proxyConfig']);
return result ? result : null;
};
@@ -353,7 +355,8 @@ ProxyFormController.prototype = {
},
/**
- * Handles the response from 'proxy.settings.get' for regular settings.
+ * Handles the response from 'proxy.settings.get' for regular
+ * settings.
*
* @param {ProxyFormController.WrappedProxyConfig} c The proxy data and
* extension's level of control thereof.
@@ -370,7 +373,8 @@ ProxyFormController.prototype = {
},
/**
- * Handles the response from 'proxy.settings.get' for incognito settings.
+ * Handles the response from 'proxy.settings.get' for incognito
+ * settings.
*
* @param {ProxyFormController.WrappedProxyConfig} c The proxy data and
* extension's level of control thereof.
@@ -505,7 +509,7 @@ ProxyFormController.prototype = {
this.config_.regular = this.generateProxyConfig_();
chrome.experimental.proxy.settings.set(
- {value: this.config_.regular, incognito: false},
+ {value: this.config_.regular, scope: 'regular'},
this.callbackForRegularSettings_.bind(this));
},
@@ -521,9 +525,10 @@ ProxyFormController.prototype = {
return;
}
if (this.config_.incognito) {
- chrome.experimental.proxy.settings.set(
- {value: this.config_.incognito, incognito: true},
- this.callbackForIncognitoSettings_.bind(this));
+ // TODO(battre): change incognito value once available
+ // chrome.experimental.proxy.settings.set(
+ // {value: this.config_.incognito, scope: 'incognito'},
+ // this.callbackForIncognitoSettings_.bind(this));
} else {
ProxyFormController.setPersistedSettings(this.config_);
this.generateAlert_(chrome.i18n.getMessage('successfullySetProxy'));

Powered by Google App Engine
This is Rietveld 408576698