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

Side by Side Diff: chrome/browser/resources/extensions/extension_options_overlay.js

Issue 484033003: Open embedded extension options from the extension action context menu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix missed cases in refactor - setting optionsShown_ in onclose, scrolling only in the context menu… Created 6 years, 3 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
« no previous file with comments | « chrome/browser/resources/extensions/extension_list.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 handleDismiss_: function(event) { 48 handleDismiss_: function(event) {
49 this.setVisible_(false); 49 this.setVisible_(false);
50 var extensionoptions = 50 var extensionoptions =
51 $('extension-options-overlay-guest') 51 $('extension-options-overlay-guest')
52 .querySelector('extensionoptions'); 52 .querySelector('extensionoptions');
53 53
54 if (extensionoptions) 54 if (extensionoptions)
55 $('extension-options-overlay-guest').removeChild(extensionoptions); 55 $('extension-options-overlay-guest').removeChild(extensionoptions);
56 56
57 $('extension-options-overlay-icon').removeAttribute('src'); 57 $('extension-options-overlay-icon').removeAttribute('src');
58
59 // Remove the options query string.
60 uber.replaceState({}, '');
58 }, 61 },
59 62
60 /** 63 /**
61 * Associate an extension with the overlay and display it. 64 * Associate an extension with the overlay and display it.
62 * @param {string} extensionId The id of the extension whose options page 65 * @param {string} extensionId The id of the extension whose options page
63 * should be displayed in the overlay. 66 * should be displayed in the overlay.
64 * @param {string} extensionName The name of the extension, which is used 67 * @param {string} extensionName The name of the extension, which is used
65 * as the header of the overlay. 68 * as the header of the overlay.
66 * @param {string} extensionIcon The URL of the extension's icon. 69 * @param {string} extensionIcon The URL of the extension's icon.
67 */ 70 */
(...skipping 19 matching lines...) Expand all
87 parseInt($('extension-options-overlay').style.maxHeight); 90 parseInt($('extension-options-overlay').style.maxHeight);
88 extensionoptions.maxheight = overlayMaxHeight - headerHeight; 91 extensionoptions.maxheight = overlayMaxHeight - headerHeight;
89 92
90 extensionoptions.minwidth = 93 extensionoptions.minwidth =
91 parseInt(window.getComputedStyle($('extension-options-overlay')) 94 parseInt(window.getComputedStyle($('extension-options-overlay'))
92 .minWidth); 95 .minWidth);
93 96
94 extensionoptions.setDeferAutoSize(true); 97 extensionoptions.setDeferAutoSize(true);
95 98
96 extensionoptions.onclose = function() { 99 extensionoptions.onclose = function() {
97 this.handleDismiss_(); 100 cr.dispatchSimpleEvent($('overlay'), 'cancelOverlay');
98 }.bind(this); 101 }.bind(this);
99 102
100 // Resize the overlay if the <extensionoptions> changes size. 103 // Resize the overlay if the <extensionoptions> changes size.
101 extensionoptions.onsizechanged = function(evt) { 104 extensionoptions.onsizechanged = function(evt) {
102 var overlayStyle = 105 var overlayStyle =
103 window.getComputedStyle($('extension-options-overlay')); 106 window.getComputedStyle($('extension-options-overlay'));
104 var oldWidth = parseInt(overlayStyle.width); 107 var oldWidth = parseInt(overlayStyle.width);
105 var oldHeight = parseInt(overlayStyle.height); 108 var oldHeight = parseInt(overlayStyle.height);
106 109
107 // animationTime is the amount of time in ms that will be used to resize 110 // animationTime is the amount of time in ms that will be used to resize
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 setVisible_: function(isVisible) { 152 setVisible_: function(isVisible) {
150 this.showOverlay_(isVisible ? $('extension-options-overlay') : null); 153 this.showOverlay_(isVisible ? $('extension-options-overlay') : null);
151 } 154 }
152 }; 155 };
153 156
154 // Export 157 // Export
155 return { 158 return {
156 ExtensionOptionsOverlay: ExtensionOptionsOverlay 159 ExtensionOptionsOverlay: ExtensionOptionsOverlay
157 }; 160 };
158 }); 161 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/extensions/extension_list.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698