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

Side by Side Diff: ash/accelerators/accelerator_dispatcher_win.cc

Issue 9224001: Fixes issue with accelerators when a menu is open (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changes as requested Created 8 years, 11 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
OLDNEW
(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 "ash/accelerators/accelerator_dispatcher.h"
6
7 #include "ash/accelerators/accelerator_controller.h"
8 #include "ash/shell.h"
9 #include "base/message_loop.h"
10 #include "base/message_pump_win.h"
11 #include "ui/aura/event.h"
12 #include "ui/base/accelerators/accelerator.h"
13
14 namespace ash {
15
16 namespace {
17
18 const int kModifierMask = (ui::EF_SHIFT_DOWN |
19 ui::EF_CONTROL_DOWN |
20 ui::EF_ALT_DOWN);
21 } // namespace
22
23 bool AcceleratorDispatcher::Dispatch(const MSG& msg) {
24 switch(msg.message) {
25 case WM_KEYDOWN:
26 case WM_SYSKEYDOWN: {
27 ash::AcceleratorController* accelerator_controller =
28 ash::Shell::GetInstance()->accelerator_controller();
29 ui::Accelerator accelerator(ui::KeyboardCodeFromNative(msg),
30 ui::EventFlagsFromNative(msg) & kModifierMask);
31 if (accelerator_controller &&
32 accelerator_controller->Process(accelerator))
33 return true;
34 }
35 }
36
37 TranslateMessage(&msg);
38 DispatchMessage(&msg);
oshima 2012/01/25 21:24:37 Doesn't this have to be nested_dispatcer_->Dispat
39 return true;
40 }
41
42 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698