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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/views/app_menu_button_win.h"
6
7 #include "ui/base/win/hwnd_util.h"
8 #include "views/widget/widget.h"
9
10 AppMenuButtonWin::AppMenuButtonWin(views::ViewMenuDelegate* menu_delegate)
11 : views::MenuButton(NULL, std::wstring(), menu_delegate, false) {
12 }
13
14 bool AppMenuButtonWin::OnKeyPressed(const views::KeyEvent& event) {
15 if (event.key_code() == ui::VKEY_SPACE) {
16 // Typical windows behavior is to show the system menu on space.
17 views::Widget* widget = GetWidget();
18 gfx::Rect bounds = widget->GetClientAreaScreenBounds();
19 ui::ShowSystemMenu(widget->GetNativeView(), bounds.x(), bounds.y() + 10);
20 return false;
21 }
22 return views::MenuButton::OnKeyPressed(event);
23 }
OLDNEW
« 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