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

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

Issue 380763003: [Win] Ctrl+W should close the User Manager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: + comment Created 6 years, 5 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
« no previous file with comments | « chrome/browser/ui/views/profiles/user_manager_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c950faae11188aaaee60739f513bea5ed3e16bbe..8c7a77bdbbc9f06c317f0e93c4a6ff4fa8bfe113 100644
--- a/chrome/browser/ui/views/profiles/user_manager_view.cc
+++ b/chrome/browser/ui/views/profiles/user_manager_view.cc
@@ -20,6 +20,7 @@
#include "ui/views/layout/fill_layout.h"
#include "ui/views/view.h"
#include "ui/views/widget/widget.h"
+#include "ui/views/window/dialog_client_view.h"
#if defined(OS_WIN)
#include "chrome/browser/shell_integration.h"
@@ -105,10 +106,17 @@ void UserManagerView::OnGuestProfileCreated(
void UserManagerView::Init(Profile* guest_profile, const GURL& url) {
web_view_ = new views::WebView(guest_profile);
- SetLayoutManager(new views::FillLayout);
+ web_view_->set_allow_accelerators(true);
AddChildView(web_view_);
+ SetLayoutManager(new views::FillLayout);
+ AddAccelerator(ui::Accelerator(ui::VKEY_W, ui::EF_CONTROL_DOWN));
DialogDelegate::CreateDialogWidget(this, NULL, NULL);
+ // Since the User Manager can be the only top level window, we don't
+ // want to accidentally quit all of Chrome if the user is just trying to
+ // unfocus the selected pod in the WebView.
+ GetDialogClientView()->RemoveAccelerator(
+ ui::Accelerator(ui::VKEY_ESCAPE, ui::EF_NONE));
#if defined(OS_WIN)
// Set the app id for the task manager to the app id of its parent
@@ -123,6 +131,13 @@ void UserManagerView::Init(Profile* guest_profile, const GURL& url) {
web_view_->RequestFocus();
}
+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;
+}
+
gfx::Size UserManagerView::GetPreferredSize() const {
return gfx::Size(kWindowWidth, kWindowHeight);
}
« no previous file with comments | « chrome/browser/ui/views/profiles/user_manager_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698