Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 51 * policyText: (string|undefined), | 51 * policyText: (string|undefined), |
| 52 * prettifiedPath: (string|undefined), | 52 * prettifiedPath: (string|undefined), |
| 53 * recommendedInstall: boolean, | 53 * recommendedInstall: boolean, |
| 54 * runtimeErrors: (Array<RuntimeError>|undefined), | 54 * runtimeErrors: (Array<RuntimeError>|undefined), |
| 55 * showAllUrls: boolean, | 55 * showAllUrls: boolean, |
| 56 * suspiciousInstall: boolean, | 56 * suspiciousInstall: boolean, |
| 57 * terminated: boolean, | 57 * terminated: boolean, |
| 58 * updateRequiredByPolicy: boolean, | 58 * updateRequiredByPolicy: boolean, |
| 59 * version: string, | 59 * version: string, |
| 60 * views: Array<{renderViewId: number, renderProcessId: number, | 60 * views: Array<{renderViewId: number, renderProcessId: number, |
| 61 * path: string, incognito: boolean, | 61 * url: string, incognito: boolean, |
| 62 * generatedBackgroundPage: boolean}>, | 62 * type: chrome.developerPrivate.ViewType}>, |
| 63 * wantsErrorCollection: boolean, | 63 * wantsErrorCollection: boolean, |
| 64 * wantsFileAccess: boolean, | 64 * wantsFileAccess: boolean, |
| 65 * warnings: (Array|undefined)}} | 65 * warnings: (Array|undefined)}} |
| 66 */ | 66 */ |
| 67 var ExtensionData; | 67 var ExtensionData; |
| 68 | 68 |
| 69 /////////////////////////////////////////////////////////////////////////////// | 69 /////////////////////////////////////////////////////////////////////////////// |
| 70 // ExtensionFocusRow: | 70 // ExtensionFocusRow: |
| 71 | 71 |
| 72 /** | 72 /** |
| (...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 721 | 721 |
| 722 // Link needs to be an only child before the list is updated. | 722 // Link needs to be an only child before the list is updated. |
| 723 while (link.nextElementSibling) | 723 while (link.nextElementSibling) |
| 724 item.removeChild(link.nextElementSibling); | 724 item.removeChild(link.nextElementSibling); |
| 725 | 725 |
| 726 // Link needs to be cleaned up if it was used before. | 726 // Link needs to be cleaned up if it was used before. |
| 727 link.textContent = ''; | 727 link.textContent = ''; |
| 728 if (link.clickHandler) | 728 if (link.clickHandler) |
| 729 link.removeEventListener('click', link.clickHandler); | 729 link.removeEventListener('click', link.clickHandler); |
| 730 | 730 |
| 731 extension.views.forEach(function(view, i) { | 731 extension.views.forEach(function(view, i) { |
|
Dan Beam
2015/03/12 00:23:15
nit: if it fits, i think this is purdier
var Vi
Devlin
2015/03/12 15:38:14
But you're missing the second view.type == - shoul
Dan Beam
2015/03/12 16:41:17
oh, doh. if it doesn't save lines don't bother, b
Devlin
2015/03/12 19:53:35
Done.
| |
| 732 var displayName = view.generatedBackgroundPage ? | 732 if (view.type == chrome.developerPrivate.ViewType.EXTENSION_DIALOG || |
| 733 loadTimeData.getString('backgroundPage') : view.path; | 733 view.type == chrome.developerPrivate.ViewType.EXTENSION_POPUP) |
| 734 return; | |
| 735 var displayName; | |
| 736 if (view.url.indexOf('chrome-extension://') == 0) { | |
| 737 var pathOffset = 'chrome-extension://'.length + 32 + 1; | |
| 738 displayName = view.url.substring(pathOffset); | |
| 739 if (displayName == '_generated_background_page.html') | |
| 740 displayName = loadTimeData.getString('backgroundPage'); | |
| 741 } else { | |
| 742 displayName = view.url; | |
| 743 } | |
| 734 var label = displayName + | 744 var label = displayName + |
| 735 (view.incognito ? | 745 (view.incognito ? |
| 736 ' ' + loadTimeData.getString('viewIncognito') : '') + | 746 ' ' + loadTimeData.getString('viewIncognito') : '') + |
| 737 (view.renderProcessId == -1 ? | 747 (view.renderProcessId == -1 ? |
| 738 ' ' + loadTimeData.getString('viewInactive') : ''); | 748 ' ' + loadTimeData.getString('viewInactive') : ''); |
| 739 link.textContent = label; | 749 link.textContent = label; |
| 740 link.clickHandler = function(e) { | 750 link.clickHandler = function(e) { |
| 741 chrome.developerPrivate.inspect({ | 751 chrome.developerPrivate.inspect({ |
| 742 extension_id: extension.id, | 752 extension_id: extension.id, |
| 743 render_process_id: view.renderProcessId, | 753 render_process_id: view.renderProcessId, |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 914 // TODO(dbeam): why do we need to focus <extensionoptions> before and | 924 // TODO(dbeam): why do we need to focus <extensionoptions> before and |
| 915 // after its showing animation? Makes very little sense to me. | 925 // after its showing animation? Makes very little sense to me. |
| 916 overlay.setInitialFocus(); | 926 overlay.setInitialFocus(); |
| 917 }, | 927 }, |
| 918 }; | 928 }; |
| 919 | 929 |
| 920 return { | 930 return { |
| 921 ExtensionList: ExtensionList | 931 ExtensionList: ExtensionList |
| 922 }; | 932 }; |
| 923 }); | 933 }); |
| OLD | NEW |