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

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

Issue 536753003: Add recommended extension installation support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ext-3
Patch Set: rebase Created 6 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
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"> 5 <include src="extension_error.js">
6 6
7 /** 7 /**
8 * The type of the extension data object. The definition is based on 8 * The type of the extension data object. The definition is based on
9 * chrome/browser/ui/webui/extensions/extension_basic_info.cc 9 * chrome/browser/ui/webui/extensions/extension_basic_info.cc
10 * and 10 * and
(...skipping 19 matching lines...) Expand all
30 * incognitoCanBeEnabled: boolean, 30 * incognitoCanBeEnabled: boolean,
31 * installWarnings: (Array|undefined), 31 * installWarnings: (Array|undefined),
32 * is_hosted_app: boolean, 32 * is_hosted_app: boolean,
33 * is_platform_app: boolean, 33 * is_platform_app: boolean,
34 * isFromStore: boolean, 34 * isFromStore: boolean,
35 * isUnpacked: boolean, 35 * isUnpacked: boolean,
36 * kioskEnabled: boolean, 36 * kioskEnabled: boolean,
37 * kioskOnly: boolean, 37 * kioskOnly: boolean,
38 * locationText: string, 38 * locationText: string,
39 * managedInstall: boolean, 39 * managedInstall: boolean,
40 * recommendedInstall: boolean,
Finnur 2014/10/06 14:01:42 It is pretty clear this list should be alphabetica
binjin 2014/10/06 18:48:47 Done.
40 * manifestErrors: (Array.<RuntimeError>|undefined), 41 * manifestErrors: (Array.<RuntimeError>|undefined),
41 * name: string, 42 * name: string,
42 * offlineEnabled: boolean, 43 * offlineEnabled: boolean,
43 * optionsOpenInTab: boolean, 44 * optionsOpenInTab: boolean,
44 * optionsUrl: string, 45 * optionsUrl: string,
45 * order: number, 46 * order: number,
46 * packagedApp: boolean, 47 * packagedApp: boolean,
47 * path: (string|undefined), 48 * path: (string|undefined),
48 * prettifiedPath: (string|undefined), 49 * prettifiedPath: (string|undefined),
49 * runtimeErrors: (Array.<RuntimeError>|undefined), 50 * runtimeErrors: (Array.<RuntimeError>|undefined),
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 var node = template.cloneNode(true); 164 var node = template.cloneNode(true);
164 node.id = extension.id; 165 node.id = extension.id;
165 166
166 if (!extension.enabled || extension.terminated) 167 if (!extension.enabled || extension.terminated)
167 node.classList.add('inactive-extension'); 168 node.classList.add('inactive-extension');
168 169
169 if (extension.managedInstall || 170 if (extension.managedInstall ||
170 extension.dependentExtensions.length > 0) { 171 extension.dependentExtensions.length > 0) {
171 node.classList.add('may-not-modify'); 172 node.classList.add('may-not-modify');
172 node.classList.add('may-not-remove'); 173 node.classList.add('may-not-remove');
174 } else if (extension.recommendedInstall) {
175 node.classList.add('may-not-remove');
173 } else if (extension.suspiciousInstall || extension.corruptInstall) { 176 } else if (extension.suspiciousInstall || extension.corruptInstall) {
174 node.classList.add('may-not-modify'); 177 node.classList.add('may-not-modify');
175 } 178 }
176 179
177 var idToHighlight = this.getIdQueryParam_(); 180 var idToHighlight = this.getIdQueryParam_();
178 if (node.id == idToHighlight) 181 if (node.id == idToHighlight)
179 node.classList.add('extension-highlight'); 182 node.classList.add('extension-highlight');
180 183
181 var item = node.querySelector('.extension-list-item'); 184 var item = node.querySelector('.extension-list-item');
182 // Prevent the image cache of extension icon by using the reloaded 185 // Prevent the image cache of extension icon by using the reloaded
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 var loadPath = node.querySelector('.load-path'); 390 var loadPath = node.querySelector('.load-path');
388 loadPath.hidden = false; 391 loadPath.hidden = false;
389 var pathLink = loadPath.querySelector('a:nth-of-type(1)'); 392 var pathLink = loadPath.querySelector('a:nth-of-type(1)');
390 pathLink.textContent = ' ' + extension.prettifiedPath; 393 pathLink.textContent = ' ' + extension.prettifiedPath;
391 pathLink.addEventListener('click', function(e) { 394 pathLink.addEventListener('click', function(e) {
392 chrome.send('extensionSettingsShowPath', [String(extension.id)]); 395 chrome.send('extensionSettingsShowPath', [String(extension.id)]);
393 e.preventDefault(); 396 e.preventDefault();
394 }); 397 });
395 } 398 }
396 399
397 // Then the 'managed, cannot uninstall/disable' message. 400 // Then the 'managed, cannot uninstall/disable' message.
Finnur 2014/10/06 14:01:42 nit: This comment is out of date now, no?
binjin 2014/10/06 18:48:47 I think the comment looks fine to me. It's not res
398 if (extension.managedInstall) { 401 if (extension.managedInstall || extension.recommendedInstall) {
399 node.querySelector('.managed-message').hidden = false; 402 node.querySelector('.managed-message').hidden = false;
400 } else { 403 } else {
401 if (extension.suspiciousInstall) { 404 if (extension.suspiciousInstall) {
402 // Then the 'This isn't from the webstore, looks suspicious' message. 405 // Then the 'This isn't from the webstore, looks suspicious' message.
403 node.querySelector('.suspicious-install-message').hidden = false; 406 node.querySelector('.suspicious-install-message').hidden = false;
404 } 407 }
405 if (extension.corruptInstall) { 408 if (extension.corruptInstall) {
406 // Then the 'This is a corrupt extension' message. 409 // Then the 'This is a corrupt extension' message.
407 node.querySelector('.corrupt-install-message').hidden = false; 410 node.querySelector('.corrupt-install-message').hidden = false;
408 } 411 }
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 $('overlay').addEventListener('cancelOverlay', function() { 541 $('overlay').addEventListener('cancelOverlay', function() {
539 this.optionsShown_ = false; 542 this.optionsShown_ = false;
540 }.bind(this)); 543 }.bind(this));
541 }, 544 },
542 }; 545 };
543 546
544 return { 547 return {
545 ExtensionsList: ExtensionsList 548 ExtensionsList: ExtensionsList
546 }; 549 };
547 }); 550 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698