| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2012 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/events/event.h" | |
| 8 #include "ui/gfx/win/hwnd_util.h" | |
| 9 #include "ui/views/widget/widget.h" | |
| 10 | |
| 11 AppMenuButtonWin::AppMenuButtonWin(views::MenuButtonListener* listener) | |
| 12 : WrenchToolbarButton(listener) { | |
| 13 } | |
| 14 | |
| 15 bool AppMenuButtonWin::OnKeyPressed(const ui::KeyEvent& event) { | |
| 16 if (event.key_code() == ui::VKEY_SPACE) { | |
| 17 // Explicitly show the system menu at a good location on [Alt]+[Space]. | |
| 18 gfx::ShowSystemMenu(GetWidget()->GetNativeView()); | |
| 19 return false; | |
| 20 } | |
| 21 return views::MenuButton::OnKeyPressed(event); | |
| 22 } | |
| OLD | NEW |