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

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

Issue 8273036: Adding `content_security_policy` to proxy sample extension. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: License, docs. Created 9 years, 2 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/background.js
diff --git a/chrome/common/extensions/docs/examples/extensions/proxy_configuration/background.js b/chrome/common/extensions/docs/examples/extensions/proxy_configuration/background.js
new file mode 100644
index 0000000000000000000000000000000000000000..8640d419e0d16678da4f4af6155a92c79bf2365f
--- /dev/null
+++ b/chrome/common/extensions/docs/examples/extensions/proxy_configuration/background.js
@@ -0,0 +1,23 @@
+// Copyright (c) 2011 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.
+
+/**
+ * @fileoverview This file initializes the background page by loading a
+ * ProxyErrorHandler, and resetting proxy settings if required.
+ *
+ * @author Mike West <mkwst@google.com>
+ */
+
+document.addEventListener("DOMContentLoaded", function () {
+ var errorHandler = new ProxyErrorHandler();
+
+ // If this extension has already set the proxy settings, then reset it
+ // once as the background page initializes. This is essential, as
+ // incognito settings are wiped on restart.
+ var persistedSettings = ProxyFormController.getPersistedSettings();
+ if (persistedSettings !== null) {
+ chrome.proxy.settings.set(
+ {'value': persistedSettings.regular});
+ }
+});

Powered by Google App Engine
This is Rietveld 408576698