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

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

Issue 22470007: Add a "key" entry to InstallWarnings, remove InstallWarning::Format (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dc_ec_infrastructure
Patch Set: 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 cr.define('options', function() { 5 cr.define('options', function() {
6 'use strict'; 6 'use strict';
7 7
8 /** 8 /**
9 * A lookup helper function to find the first node that has an id (starting 9 * A lookup helper function to find the first node that has an id (starting
10 * at |node| and going up the parent chain). 10 * at |node| and going up the parent chain).
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 }); 320 });
321 } 321 }
322 322
323 // The install warnings. 323 // The install warnings.
324 if (extension.installWarnings) { 324 if (extension.installWarnings) {
325 var panel = node.querySelector('.install-warnings'); 325 var panel = node.querySelector('.install-warnings');
326 panel.hidden = false; 326 panel.hidden = false;
327 var list = panel.querySelector('ul'); 327 var list = panel.querySelector('ul');
328 extension.installWarnings.forEach(function(warning) { 328 extension.installWarnings.forEach(function(warning) {
329 var li = document.createElement('li'); 329 var li = document.createElement('li');
330 li[warning.isHTML ? 'innerHTML' : 'innerText'] = warning.message; 330 li.innerText = warning.message;
331 list.appendChild(li); 331 list.appendChild(li);
332 }); 332 });
333 } 333 }
334 334
335 this.appendChild(node); 335 this.appendChild(node);
336 if (location.hash.substr(1) == extension.id) { 336 if (location.hash.substr(1) == extension.id) {
337 // Scroll beneath the fixed header so that the extension is not 337 // Scroll beneath the fixed header so that the extension is not
338 // obscured. 338 // obscured.
339 var topScroll = node.offsetTop - $('page-header').offsetHeight; 339 var topScroll = node.offsetTop - $('page-header').offsetHeight;
340 var pad = parseInt(getComputedStyle(node, null).marginTop, 10); 340 var pad = parseInt(getComputedStyle(node, null).marginTop, 10);
341 if (!isNaN(pad)) 341 if (!isNaN(pad))
342 topScroll -= pad / 2; 342 topScroll -= pad / 2;
343 document.body.scrollTop = topScroll; 343 document.body.scrollTop = topScroll;
344 } 344 }
345 } 345 }
346 }; 346 };
347 347
348 return { 348 return {
349 ExtensionsList: ExtensionsList 349 ExtensionsList: ExtensionsList
350 }; 350 };
351 }); 351 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698