Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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('extensions', function() { | 5 cr.define('extensions', function() { |
| 6 'use strict'; | 6 'use strict'; |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * The ExtensionOptionsOverlay will show an extension's options page using | 9 * The ExtensionOptionsOverlay will show an extension's options page using |
| 10 * an <extensionoptions> element. | 10 * an <extensionoptions> element. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 43 /** | 43 /** |
| 44 * Handles a click on the close button. | 44 * Handles a click on the close button. |
| 45 * @param {Event} e The click event. | 45 * @param {Event} e The click event. |
| 46 * @private | 46 * @private |
| 47 */ | 47 */ |
| 48 handleDismiss_: function(event) { | 48 handleDismiss_: function(event) { |
| 49 this.setVisible_(false); | 49 this.setVisible_(false); |
| 50 var extensionoptions = document.querySelector('extensionoptions'); | 50 var extensionoptions = document.querySelector('extensionoptions'); |
| 51 if (extensionoptions) | 51 if (extensionoptions) |
| 52 $('extension-options-overlay').removeChild(extensionoptions); | 52 $('extension-options-overlay').removeChild(extensionoptions); |
| 53 | |
| 54 // Remove the options query string | |
|
Devlin
2014/08/21 17:18:19
nit: .
ericzeng
2014/08/21 17:59:52
Done.
| |
| 55 window.parent.postMessage({ | |
| 56 method: 'updateHistory', | |
| 57 params: {state: {}, path: '', replace: false} | |
| 58 }, 'chrome://chrome'); | |
| 53 }, | 59 }, |
| 54 | 60 |
| 55 /** | 61 /** |
| 56 * Associate an extension with the overlay and display it. | 62 * Associate an extension with the overlay and display it. |
| 57 * @param {string} extensionId The id of the extension whose options page | 63 * @param {string} extensionId The id of the extension whose options page |
| 58 * should be displayed in the overlay. | 64 * should be displayed in the overlay. |
| 59 * @param {string} extensionName The name of the extension, which is used | 65 * @param {string} extensionName The name of the extension, which is used |
| 60 * as the header of the overlay. | 66 * as the header of the overlay. |
| 61 */ | 67 */ |
| 62 setExtensionAndShowOverlay: function(extensionId, extensionName) { | 68 setExtensionAndShowOverlay: function(extensionId, extensionName) { |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 85 setVisible_: function(isVisible) { | 91 setVisible_: function(isVisible) { |
| 86 this.showOverlay_(isVisible ? $('extension-options-overlay') : null); | 92 this.showOverlay_(isVisible ? $('extension-options-overlay') : null); |
| 87 } | 93 } |
| 88 }; | 94 }; |
| 89 | 95 |
| 90 // Export | 96 // Export |
| 91 return { | 97 return { |
| 92 ExtensionOptionsOverlay: ExtensionOptionsOverlay | 98 ExtensionOptionsOverlay: ExtensionOptionsOverlay |
| 93 }; | 99 }; |
| 94 }); | 100 }); |
| OLD | NEW |