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

Unified Diff: chrome/browser/ui/views/app_menu_button_win.cc

Issue 7237032: Changes wrench menu button to show system menu on space. This matches (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tweak comment Created 9 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/app_menu_button_win.h ('k') | chrome/browser/ui/views/toolbar_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/app_menu_button_win.cc
diff --git a/chrome/browser/ui/views/app_menu_button_win.cc b/chrome/browser/ui/views/app_menu_button_win.cc
new file mode 100644
index 0000000000000000000000000000000000000000..0bf0990e27e689eef98b9dd5a37f75135bc7e421
--- /dev/null
+++ b/chrome/browser/ui/views/app_menu_button_win.cc
@@ -0,0 +1,23 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/views/app_menu_button_win.h"
+
+#include "ui/base/win/hwnd_util.h"
+#include "views/widget/widget.h"
+
+AppMenuButtonWin::AppMenuButtonWin(views::ViewMenuDelegate* menu_delegate)
+ : views::MenuButton(NULL, std::wstring(), menu_delegate, false) {
+}
+
+bool AppMenuButtonWin::OnKeyPressed(const views::KeyEvent& event) {
+ if (event.key_code() == ui::VKEY_SPACE) {
+ // Typical windows behavior is to show the system menu on space.
+ views::Widget* widget = GetWidget();
+ gfx::Rect bounds = widget->GetClientAreaScreenBounds();
+ ui::ShowSystemMenu(widget->GetNativeView(), bounds.x(), bounds.y() + 10);
+ return false;
+ }
+ return views::MenuButton::OnKeyPressed(event);
+}
« no previous file with comments | « chrome/browser/ui/views/app_menu_button_win.h ('k') | chrome/browser/ui/views/toolbar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698