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

Unified Diff: chrome/browser/resources/extensions/extension_options_overlay.js

Issue 900623003: extensions: focus options overlay content when shown. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@policy-icon-label
Patch Set: merge Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/extensions/extension_options_overlay.js
diff --git a/chrome/browser/resources/extensions/extension_options_overlay.js b/chrome/browser/resources/extensions/extension_options_overlay.js
index 174e16e63cf2ffb05e315595228c149519c6b1fe..409e5dc2fc07d1a0b9c739f3852808ee821e3c30 100644
--- a/chrome/browser/resources/extensions/extension_options_overlay.js
+++ b/chrome/browser/resources/extensions/extension_options_overlay.js
@@ -40,6 +40,16 @@ cr.define('extensions', function() {
this.showOverlay_ = showOverlay;
},
+ setInitialFocus: function() {
+ this.getExentionOptions_().focus();
+ },
+
+ /** @return {?Element} */
+ getExentionOptions_: function() {
not at google - send to devlin 2015/02/03 20:52:04 Exention -> Extension kudos on being consistent,
Dan Beam 2015/02/04 17:15:38 Done. (ah, the magic of Ctrl+n)
+ return $('extension-options-overlay-guest').querySelector(
+ 'extensionoptions');
+ },
+
/**
* Handles a click on the close button.
* @param {Event} event The click event.
@@ -47,10 +57,7 @@ cr.define('extensions', function() {
*/
handleDismiss_: function(event) {
this.setVisible_(false);
- var extensionoptions =
- $('extension-options-overlay-guest')
- .querySelector('extensionoptions');
-
+ var extensionoptions = this.getExentionOptions_();
if (extensionoptions)
$('extension-options-overlay-guest').removeChild(extensionoptions);
@@ -125,9 +132,9 @@ cr.define('extensions', function() {
Math.pow(newWidth - oldWidth, 2) +
Math.pow(newHeight - oldHeight, 2));
- if (animation) {
+ if (animation)
animation.cancel();
- }
+
animation = overlay.animate([
{width: oldWidth + 'px', height: oldHeight + 'px'},
{width: newWidth + 'px', height: newHeight + 'px'}
@@ -138,13 +145,16 @@ cr.define('extensions', function() {
animation.onfinish = function(e) {
animation = null;
+
// The <extensionoptions> element is ready to place back in the
- // overlay. Make sure that it's sized to take up the full
- // width/height of the overlay.
+ // overlay. Make sure that it's sized to take up the full width/height
+ // of the overlay.
overlayGuest.style.position = '';
overlayGuest.style.left = '';
overlayGuest.style.width = newWidth + 'px';
overlayGuest.style.height = newHeight + 'px';
+
+ cr.dispatchSimpleEvent($('overlay'), 'animationFinished');
};
}.bind(this);

Powered by Google App Engine
This is Rietveld 408576698