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

Unified Diff: chrome/browser/ui/views/profiles/user_manager_view.cc

Issue 553133002: [Mac] Add text-editing accelerators to the User Manager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/profiles/user_manager_view.cc
diff --git a/chrome/browser/ui/views/profiles/user_manager_view.cc b/chrome/browser/ui/views/profiles/user_manager_view.cc
index 8f6a80ccd6a377c090e9a8801e9cf60eeee93d11..efa31636ac57a203408c3776a3941613a14eef58 100644
--- a/chrome/browser/ui/views/profiles/user_manager_view.cc
+++ b/chrome/browser/ui/views/profiles/user_manager_view.cc
@@ -116,6 +116,9 @@ void UserManagerView::Init(
web_view_->set_allow_accelerators(true);
AddChildView(web_view_);
SetLayoutManager(new views::FillLayout);
+
+ // Only handle close window accelerators or accelerators that make sense in
+ // the locked pod password field.
AddAccelerator(ui::Accelerator(ui::VKEY_W, ui::EF_CONTROL_DOWN));
// If the user manager is being displayed from an existing profile, use
@@ -168,10 +171,14 @@ void UserManagerView::Init(
}
bool UserManagerView::AcceleratorPressed(const ui::Accelerator& accelerator) {
- DCHECK_EQ(ui::VKEY_W, accelerator.key_code());
DCHECK_EQ(ui::EF_CONTROL_DOWN, accelerator.modifiers());
- GetWidget()->Close();
- return true;
+
+ // Handle the close window accelerator, and let the WebView handle the rest.
+ if (accelerator.key_code() == ui::VKEY_W) {
sky 2014/09/10 16:21:15 How do you end up here for other accelerator types
noms (inactive) 2014/09/10 16:55:09 Oh weird, you're right. This seems to work without
+ GetWidget()->Close();
+ return true;
+ }
+ return false;
}
gfx::Size UserManagerView::GetPreferredSize() const {

Powered by Google App Engine
This is Rietveld 408576698