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

Side by Side Diff: views/widget/accelerator_handler.cc

Issue 159046: Implementing accelerators for Linux toolkit_views (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 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 | « views/widget/accelerator_handler.h ('k') | views/widget/widget_gtk.h » ('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) 2006-2008 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 "views/widget/accelerator_handler.h"
6
7 #include "views/focus/focus_manager.h"
8
9 namespace views {
10
11 AcceleratorHandler::AcceleratorHandler() {
12 }
13
14 bool AcceleratorHandler::Dispatch(const MSG& msg) {
15 bool process_message = true;
16
17 if (msg.message >= WM_KEYFIRST && msg.message <= WM_KEYLAST) {
18 FocusManager* focus_manager =
19 FocusManager::GetFocusManagerForNativeView(msg.hwnd);
20 if (focus_manager) {
21 // FocusManager::OnKeyDown and OnKeyUp return false if this message has
22 // been consumed and should not be propagated further.
23 switch (msg.message) {
24 case WM_KEYDOWN:
25 case WM_SYSKEYDOWN:
26 process_message = focus_manager->OnKeyDown(msg.hwnd, msg.message,
27 msg.wParam, msg.lParam);
28 break;
29 }
30 }
31 }
32
33 if (process_message) {
34 TranslateMessage(&msg);
35 DispatchMessage(&msg);
36 }
37
38 return true;
39 }
40
41 } // namespace views
OLDNEW
« no previous file with comments | « views/widget/accelerator_handler.h ('k') | views/widget/widget_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698