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

Side by Side Diff: chrome/browser/resources/extensions/extension_list.js

Issue 22938005: Add ErrorConsole UI for Extension Install Warnings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dc_ec_install_warnings
Patch Set: Dan's Created 7 years, 4 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 <include src="extension_error.js"></include>
6
5 cr.define('options', function() { 7 cr.define('options', function() {
6 'use strict'; 8 'use strict';
7 9
8 /** 10 /**
9 * A lookup helper function to find the first node that has an id (starting
10 * at |node| and going up the parent chain).
11 * @param {Element} node The node to start looking at.
12 */
13 function findIdNode(node) {
14 while (node && !node.id) {
15 node = node.parentNode;
16 }
17 return node;
18 }
19
20 /**
21 * Creates a new list of extensions. 11 * Creates a new list of extensions.
22 * @param {Object=} opt_propertyBag Optional properties. 12 * @param {Object=} opt_propertyBag Optional properties.
23 * @constructor 13 * @constructor
24 * @extends {cr.ui.div} 14 * @extends {cr.ui.div}
25 */ 15 */
26 var ExtensionsList = cr.ui.define('div'); 16 var ExtensionsList = cr.ui.define('div');
27 17
28 /** 18 /**
29 * @type {Object.<string, boolean>} A map from extension id to a boolean 19 * @type {Object.<string, boolean>} A map from extension id to a boolean
30 * indicating whether the incognito warning is showing. This persists 20 * indicating whether the incognito warning is showing. This persists
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 // The extension warnings (describing runtime issues). 305 // The extension warnings (describing runtime issues).
316 if (extension.warnings) { 306 if (extension.warnings) {
317 var panel = node.querySelector('.extension-warnings'); 307 var panel = node.querySelector('.extension-warnings');
318 panel.hidden = false; 308 panel.hidden = false;
319 var list = panel.querySelector('ul'); 309 var list = panel.querySelector('ul');
320 extension.warnings.forEach(function(warning) { 310 extension.warnings.forEach(function(warning) {
321 list.appendChild(document.createElement('li')).innerText = warning; 311 list.appendChild(document.createElement('li')).innerText = warning;
322 }); 312 });
323 } 313 }
324 314
325 // The install warnings. 315 // The manifest errors and warnings.
326 if (extension.installWarnings) { 316 if (extension.manifestErrors) {
327 var panel = node.querySelector('.install-warnings'); 317 var manifestErrors = node.querySelector('.manifest-errors');
328 panel.hidden = false; 318 manifestErrors.hidden = false;
329 var list = panel.querySelector('ul'); 319 manifestErrors.appendChild(
330 extension.installWarnings.forEach(function(warning) { 320 new extensions.ExtensionErrorList(extension.manifestErrors));
331 var li = document.createElement('li');
332 li.innerText = warning.message;
333 list.appendChild(li);
334 });
335 } 321 }
336 322
337 this.appendChild(node); 323 this.appendChild(node);
338 if (location.hash.substr(1) == extension.id) { 324 if (location.hash.substr(1) == extension.id) {
339 // Scroll beneath the fixed header so that the extension is not 325 // Scroll beneath the fixed header so that the extension is not
340 // obscured. 326 // obscured.
341 var topScroll = node.offsetTop - $('page-header').offsetHeight; 327 var topScroll = node.offsetTop - $('page-header').offsetHeight;
342 var pad = parseInt(getComputedStyle(node, null).marginTop, 10); 328 var pad = parseInt(getComputedStyle(node, null).marginTop, 10);
343 if (!isNaN(pad)) 329 if (!isNaN(pad))
344 topScroll -= pad / 2; 330 topScroll -= pad / 2;
345 document.body.scrollTop = topScroll; 331 document.body.scrollTop = topScroll;
346 } 332 }
347 } 333 },
348 }; 334 };
349 335
350 return { 336 return {
351 ExtensionsList: ExtensionsList 337 ExtensionsList: ExtensionsList
352 }; 338 };
353 }); 339 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698