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

Side by Side Diff: chrome/browser/resources/script_bubble/popup.js

Issue 11308302: Delete the old extension-based script bubble. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years 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
« no previous file with comments | « chrome/browser/resources/script_bubble/popup.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 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
5 init();
6
7 function init() {
8 var extensionIds = location.hash.substring(1).split(',');
9 populateHeading(extensionIds.length);
10
11 var template = document.querySelector('.row');
12 extensionIds.forEach(populateRow.bind(null, template));
13 }
14
15 function populateHeading(numExtensions) {
16 // TODO(aa): Internationalize. Copy whatever bookmark manager is doing.
17 var singular = ' extension is interacting with this page';
18 var plural = ' extensions are interacting with this page';
19 var phrase = numExtensions == 1 ? singular : plural;
20 document.querySelector('h1').textContent = numExtensions + phrase;
21 }
22
23 function populateRow(template, extensionId) {
24 chrome.management.get(extensionId, function(info) {
25 var row = template.cloneNode(true);
26 row.querySelector('.icon').src =
27 'chrome://extension-icon/' + extensionId + '/16/1';
28 row.querySelector('.name').textContent = info.name;
29 row.classList.remove('template');
30 template.parentNode.appendChild(row);
31 });
32 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/script_bubble/popup.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698