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

Side by Side Diff: views/focus/accelerator_handler_win.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/focus/accelerator_handler_gtk.cc ('k') | views/focus/focus_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Name: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2009 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/focus/accelerator_handler.h"
6
7 #include "views/event.h"
8 #include "views/focus/focus_manager.h"
9
10 namespace views {
11
12 AcceleratorHandler::AcceleratorHandler() {
13 }
14
15 bool AcceleratorHandler::Dispatch(const MSG& msg) {
16 bool process_message = true;
17
18 if (msg.message >= WM_KEYFIRST && msg.message <= WM_KEYLAST) {
19 FocusManager* focus_manager =
20 FocusManager::GetFocusManagerForNativeView(msg.hwnd);
21 if (focus_manager) {
22 switch (msg.message) {
23 case WM_KEYDOWN:
24 case WM_SYSKEYDOWN: {
25 KeyEvent event(Event::ET_KEY_PRESSED,
26 msg.wParam,
27 msg.lParam & 0xFFFF,
28 (msg.lParam & 0xFFFF0000) >> 16);
29 process_message = focus_manager->OnKeyEvent(event);
30 break;
31 }
32 }
33 }
34 }
35
36 if (process_message) {
37 TranslateMessage(&msg);
38 DispatchMessage(&msg);
39 }
40
41 return true;
42 }
43
44 } // namespace views
OLDNEW
« no previous file with comments | « views/focus/accelerator_handler_gtk.cc ('k') | views/focus/focus_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698