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

Unified Diff: chrome/common/extensions/docs/examples/extensions/mappy/background.html

Issue 8311007: Adding `content_security_policy` to the "Mappy" sample. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Rebasing. 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/mappy/background.html
diff --git a/chrome/common/extensions/docs/examples/extensions/mappy/background.html b/chrome/common/extensions/docs/examples/extensions/mappy/background.html
index ff6f7c9cfa16895446c8c1672d45c8003cfd92e5..6de21588c8118b2b1acb3d954898662526139282 100644
--- a/chrome/common/extensions/docs/examples/extensions/mappy/background.html
+++ b/chrome/common/extensions/docs/examples/extensions/mappy/background.html
@@ -1,42 +1,9 @@
-<script>
-// Global accessor that the popup uses.
-var addresses = {};
-var selectedAddress = null;
-var selectedId = null;
-
-function updateAddress(tabId) {
- chrome.tabs.sendRequest(tabId, {}, function(address) {
- addresses[tabId] = address;
- if (!address) {
- chrome.pageAction.hide(tabId);
- } else {
- chrome.pageAction.show(tabId);
- if (selectedId == tabId) {
- updateSelected(tabId);
- }
- }
- });
-}
-
-function updateSelected(tabId) {
- selectedAddress = addresses[tabId];
- if (selectedAddress)
- chrome.pageAction.setTitle({tabId:tabId, title:selectedAddress});
-}
-
-chrome.tabs.onUpdated.addListener(function(tabId, change, tab) {
- if (change.status == "complete") {
- updateAddress(tabId);
- }
-});
-
-chrome.tabs.onSelectionChanged.addListener(function(tabId, info) {
- selectedId = tabId;
- updateSelected(tabId);
-});
-
-// Ensure the current selected tab is set up.
-chrome.tabs.getSelected(null, function(tab) {
- updateAddress(tab.id);
-});
-</script>
+<!doctype html>
+<html>
+ <head>
+ <title>Background Page</title>
+ <script src="background.js"></script>
+ </head>
+ <body>
+ </body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698