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

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, more fix 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 28 matching lines...) Expand all
39 * managedInstall: boolean, 39 * managedInstall: boolean,
40 * manifestErrors: (Array.<RuntimeError>|undefined), 40 * manifestErrors: (Array.<RuntimeError>|undefined),
41 * name: string, 41 * name: string,
42 * offlineEnabled: boolean, 42 * offlineEnabled: boolean,
43 * optionsOpenInTab: boolean, 43 * optionsOpenInTab: boolean,
44 * optionsUrl: string, 44 * optionsUrl: string,
45 * order: number, 45 * order: number,
46 * packagedApp: boolean, 46 * packagedApp: boolean,
47 * path: (string|undefined), 47 * path: (string|undefined),
48 * prettifiedPath: (string|undefined), 48 * prettifiedPath: (string|undefined),
49 * recommendedInstall: boolean,
49 * runtimeErrors: (Array.<RuntimeError>|undefined), 50 * runtimeErrors: (Array.<RuntimeError>|undefined),
50 * suspiciousInstall: boolean, 51 * suspiciousInstall: boolean,
51 * terminated: boolean, 52 * terminated: boolean,
52 * version: string, 53 * version: string,
53 * views: Array.<{renderViewId: number, renderProcessId: number, 54 * views: Array.<{renderViewId: number, renderProcessId: number,
54 * path: string, incognito: boolean, 55 * path: string, incognito: boolean,
55 * generatedBackgroundPage: boolean}>, 56 * generatedBackgroundPage: boolean}>,
56 * wantsAllUrls: boolean, 57 * wantsAllUrls: boolean,
57 * wantsErrorCollection: boolean, 58 * wantsErrorCollection: boolean,
58 * wantsFileAccess: boolean, 59 * wantsFileAccess: boolean,
(...skipping 104 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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
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.
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
« no previous file with comments | « chrome/browser/policy/policy_browsertest.cc ('k') | chrome/browser/ui/webui/extensions/extension_settings_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698