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

Unified Diff: chrome/browser/resources/md_bookmarks/command_manager.js

Issue 2954273002: [MD Bookmarks] Restore focus after closing a dialog or context menu. (Closed)
Patch Set: fix deps Created 3 years, 6 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/md_bookmarks/command_manager.js
diff --git a/chrome/browser/resources/md_bookmarks/command_manager.js b/chrome/browser/resources/md_bookmarks/command_manager.js
index 790fb62d25f78f89ebc83ab8ef47e1f07686d10f..f0b37bf7c7c1157d3f385e5842f8d67729da42e6 100644
--- a/chrome/browser/resources/md_bookmarks/command_manager.js
+++ b/chrome/browser/resources/md_bookmarks/command_manager.js
@@ -109,11 +109,15 @@ cr.define('bookmarks', function() {
*/
openCommandMenuAtPosition: function(x, y, items) {
this.menuIds_ = items || this.getState().selection.items;
+
var dropdown =
/** @type {!CrActionMenuElement} */ (this.$.dropdown.get());
// Ensure that the menu is fully rendered before trying to position it.
Polymer.dom.flush();
- dropdown.showAtPosition({top: y, left: x});
+ bookmarks.DialogFocusManager.getInstance().showDialog(
+ dropdown, function() {
+ dropdown.showAtPosition({top: y, left: x});
+ });
},
/**
@@ -123,11 +127,15 @@ cr.define('bookmarks', function() {
*/
openCommandMenuAtElement: function(target) {
this.menuIds_ = this.getState().selection.items;
+
var dropdown =
/** @type {!CrActionMenuElement} */ (this.$.dropdown.get());
// Ensure that the menu is fully rendered before trying to position it.
Polymer.dom.flush();
- dropdown.showAt(target);
+ bookmarks.DialogFocusManager.getInstance().showDialog(
+ dropdown, function() {
+ dropdown.showAt(target);
+ });
},
closeCommandMenu: function() {
@@ -384,7 +392,9 @@ cr.define('bookmarks', function() {
var dialog = this.$.openDialog.get();
dialog.querySelector('.body').textContent =
loadTimeData.getStringF('openDialogBody', urls.length);
- dialog.showModal();
+
+ bookmarks.DialogFocusManager.getInstance().showDialog(
+ this.$.openDialog.get());
},
/**

Powered by Google App Engine
This is Rietveld 408576698