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 // ExtensionFocusRow: | 8 // ExtensionFocusRow: |
9 | 9 |
10 /** | 10 /** |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 * @private | 165 * @private |
166 */ | 166 */ |
167 optionsShown_: false, | 167 optionsShown_: false, |
168 | 168 |
169 /** @private {!cr.ui.FocusGrid} */ | 169 /** @private {!cr.ui.FocusGrid} */ |
170 focusGrid_: new cr.ui.FocusGrid(), | 170 focusGrid_: new cr.ui.FocusGrid(), |
171 | 171 |
172 /** | 172 /** |
173 * Indicates whether an uninstall dialog is being shown to prevent multiple | 173 * Indicates whether an uninstall dialog is being shown to prevent multiple |
174 * dialogs from being displayed. | 174 * dialogs from being displayed. |
175 * @type {boolean} | 175 * @private {boolean} |
176 * @private | |
177 */ | 176 */ |
178 uninstallIsShowing_: false, | 177 uninstallIsShowing_: false, |
179 | 178 |
180 /** | 179 /** |
| 180 * Indicates whether a permissions prompt is showing. |
| 181 * @private {boolean} |
| 182 */ |
| 183 permissionsPromptIsShowing_: false, |
| 184 |
| 185 /** |
181 * Necessary to only show the butterbar once. | 186 * Necessary to only show the butterbar once. |
182 * @private {boolean} | 187 * @private {boolean} |
183 */ | 188 */ |
184 butterbarShown_: false, | 189 butterbarShown_: false, |
185 | 190 |
186 decorate: function() { | 191 decorate: function() { |
187 chrome.developerPrivate.getExtensionsInfo( | 192 chrome.developerPrivate.getExtensionsInfo( |
188 {includeDisabled: true, includeTerminated: true}, | 193 {includeDisabled: true, includeTerminated: true}, |
189 function(extensions) { | 194 function(extensions) { |
190 // Sort in order of unpacked vs. packed, followed by name, followed by | 195 // Sort in order of unpacked vs. packed, followed by name, followed by |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 row.setupColumn('.options-button', 'options', 'click', function(e) { | 373 row.setupColumn('.options-button', 'options', 'click', function(e) { |
369 this.showEmbeddedExtensionOptions_(extension.id, false); | 374 this.showEmbeddedExtensionOptions_(extension.id, false); |
370 e.preventDefault(); | 375 e.preventDefault(); |
371 }.bind(this)); | 376 }.bind(this)); |
372 | 377 |
373 // The 'View in Web Store/View Web Site' link. | 378 // The 'View in Web Store/View Web Site' link. |
374 row.querySelector('.site-link').setAttribute('column-type', 'website'); | 379 row.querySelector('.site-link').setAttribute('column-type', 'website'); |
375 | 380 |
376 // The 'Permissions' link. | 381 // The 'Permissions' link. |
377 row.setupColumn('.permissions-link', 'details', 'click', function(e) { | 382 row.setupColumn('.permissions-link', 'details', 'click', function(e) { |
378 chrome.send('extensionSettingsPermissions', [extension.id]); | 383 if (!this.permissionsPromptIsShowing_) { |
| 384 chrome.developerPrivate.showPermissionsDialog(extension.id, |
| 385 function() { |
| 386 this.permissionsPromptIsShowing_ = false; |
| 387 }.bind(this)); |
| 388 this.permissionsPromptIsShowing_ = true; |
| 389 } |
379 e.preventDefault(); | 390 e.preventDefault(); |
380 }); | 391 }); |
381 | 392 |
382 // The 'Reload' link. | 393 // The 'Reload' link. |
383 row.setupColumn('.reload-link', 'localReload', 'click', function(e) { | 394 row.setupColumn('.reload-link', 'localReload', 'click', function(e) { |
384 chrome.developerPrivate.reload(extension.id, {failQuietly: true}); | 395 chrome.developerPrivate.reload(extension.id, {failQuietly: true}); |
385 extensionReloadedTimestamp[extension.id] = Date.now(); | 396 extensionReloadedTimestamp[extension.id] = Date.now(); |
386 }); | 397 }); |
387 | 398 |
388 // The 'Launch' link. | 399 // The 'Launch' link. |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
903 // TODO(dbeam): why do we need to focus <extensionoptions> before and | 914 // TODO(dbeam): why do we need to focus <extensionoptions> before and |
904 // after its showing animation? Makes very little sense to me. | 915 // after its showing animation? Makes very little sense to me. |
905 overlay.setInitialFocus(); | 916 overlay.setInitialFocus(); |
906 }, | 917 }, |
907 }; | 918 }; |
908 | 919 |
909 return { | 920 return { |
910 ExtensionList: ExtensionList | 921 ExtensionList: ExtensionList |
911 }; | 922 }; |
912 }); | 923 }); |
OLD | NEW |