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

Side by Side Diff: chrome/common/extensions/docs/examples/extensions/mappy/background.js

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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <script> 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
2 // Global accessor that the popup uses. 5 // Global accessor that the popup uses.
3 var addresses = {}; 6 var addresses = {};
4 var selectedAddress = null; 7 var selectedAddress = null;
5 var selectedId = null; 8 var selectedId = null;
6 9
7 function updateAddress(tabId) { 10 function updateAddress(tabId) {
8 chrome.tabs.sendRequest(tabId, {}, function(address) { 11 chrome.tabs.sendRequest(tabId, {}, function(address) {
9 addresses[tabId] = address; 12 addresses[tabId] = address;
10 if (!address) { 13 if (!address) {
11 chrome.pageAction.hide(tabId); 14 chrome.pageAction.hide(tabId);
(...skipping 20 matching lines...) Expand all
32 35
33 chrome.tabs.onSelectionChanged.addListener(function(tabId, info) { 36 chrome.tabs.onSelectionChanged.addListener(function(tabId, info) {
34 selectedId = tabId; 37 selectedId = tabId;
35 updateSelected(tabId); 38 updateSelected(tabId);
36 }); 39 });
37 40
38 // Ensure the current selected tab is set up. 41 // Ensure the current selected tab is set up.
39 chrome.tabs.getSelected(null, function(tab) { 42 chrome.tabs.getSelected(null, function(tab) {
40 updateAddress(tab.id); 43 updateAddress(tab.id);
41 }); 44 });
42 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698