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 cr.define('extensions', function() { | 7 cr.define('extensions', function() { |
| 8 'use strict'; | 8 'use strict'; |
| 9 | 9 |
| 10 var ExtensionType = chrome.developerPrivate.ExtensionType; | 10 var ExtensionType = chrome.developerPrivate.ExtensionType; |
| (...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 977 | 977 |
| 978 if (!extension) | 978 if (!extension) |
| 979 return; | 979 return; |
| 980 | 980 |
| 981 if (scroll) | 981 if (scroll) |
| 982 this.scrollToWrapper_(extensionId); | 982 this.scrollToWrapper_(extensionId); |
| 983 | 983 |
| 984 // Add the options query string. Corner case: the 'options' query string | 984 // Add the options query string. Corner case: the 'options' query string |
| 985 // will clobber the 'id' query string if the options link is clicked when | 985 // will clobber the 'id' query string if the options link is clicked when |
| 986 // 'id' is in the URL, or if both query strings are in the URL. | 986 // 'id' is in the URL, or if both query strings are in the URL. |
| 987 uber.replaceState({}, '?options=' + extensionId); | 987 window.history.replaceState({}, '', '/?options=' + extensionId); |
|
Devlin
2017/06/12 14:17:18
why window.history instead of history? (I can't f
Dan Beam
2017/06/12 23:13:12
it's because of the way it's externed:
https://git
Devlin
2017/06/13 18:04:21
Ah, interesting...
Dan Beam
2017/06/13 18:15:16
Acknowledged.
| |
| 988 | 988 |
| 989 var overlay = extensions.ExtensionOptionsOverlay.getInstance(); | 989 var overlay = extensions.ExtensionOptionsOverlay.getInstance(); |
| 990 var shownCallback = function() { | 990 var shownCallback = function() { |
| 991 // This overlay doesn't get focused automatically as <extensionoptions> | 991 // This overlay doesn't get focused automatically as <extensionoptions> |
| 992 // is created after the overlay is shown. | 992 // is created after the overlay is shown. |
| 993 if (cr.ui.FocusOutlineManager.forDocument(document).visible) | 993 if (cr.ui.FocusOutlineManager.forDocument(document).visible) |
| 994 overlay.setInitialFocus(); | 994 overlay.setInitialFocus(); |
| 995 }; | 995 }; |
| 996 overlay.setExtensionAndShow(extensionId, extension.name, | 996 overlay.setExtensionAndShow(extensionId, extension.name, |
| 997 extension.iconUrl, shownCallback); | 997 extension.iconUrl, shownCallback); |
| 998 this.optionsShown_ = true; | 998 this.optionsShown_ = true; |
| 999 | 999 |
| 1000 var self = this; | 1000 var self = this; |
| 1001 $('overlay').addEventListener('cancelOverlay', function f() { | 1001 $('overlay').addEventListener('cancelOverlay', function f() { |
| 1002 self.optionsShown_ = false; | 1002 self.optionsShown_ = false; |
| 1003 $('overlay').removeEventListener('cancelOverlay', f); | 1003 $('overlay').removeEventListener('cancelOverlay', f); |
| 1004 | 1004 |
| 1005 // Remove the options query string. | 1005 // Remove the options query string. |
| 1006 uber.replaceState({}, ''); | 1006 window.history.replaceState({}, '', '/'); |
| 1007 }); | 1007 }); |
| 1008 | 1008 |
| 1009 // TODO(dbeam): why do we need to focus <extensionoptions> before and | 1009 // TODO(dbeam): why do we need to focus <extensionoptions> before and |
| 1010 // after its showing animation? Makes very little sense to me. | 1010 // after its showing animation? Makes very little sense to me. |
| 1011 overlay.setInitialFocus(); | 1011 overlay.setInitialFocus(); |
| 1012 }, | 1012 }, |
| 1013 | 1013 |
| 1014 /** | 1014 /** |
| 1015 * Hides the extension options overlay for the extension with id | 1015 * Hides the extension options overlay for the extension with id |
| 1016 * |extensionId|. If there is an overlay showing for a different extension, | 1016 * |extensionId|. If there is an overlay showing for a different extension, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1055 this.createWrapper_(extension, nextExt ? $(nextExt.id) : null); | 1055 this.createWrapper_(extension, nextExt ? $(nextExt.id) : null); |
| 1056 } | 1056 } |
| 1057 } | 1057 } |
| 1058 }; | 1058 }; |
| 1059 | 1059 |
| 1060 return { | 1060 return { |
| 1061 ExtensionList: ExtensionList, | 1061 ExtensionList: ExtensionList, |
| 1062 ExtensionListDelegate: ExtensionListDelegate | 1062 ExtensionListDelegate: ExtensionListDelegate |
| 1063 }; | 1063 }; |
| 1064 }); | 1064 }); |
| OLD | NEW |