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

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

Issue 11411308: Enable script bubble by default on all but mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Everything passes 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
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') | chrome/common/extensions/feature_switch.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698