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

Unified 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, 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « views/focus/accelerator_handler_gtk.cc ('k') | views/focus/focus_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/focus/accelerator_handler_win.cc
===================================================================
--- views/focus/accelerator_handler_win.cc (revision 0)
+++ views/focus/accelerator_handler_win.cc (revision 0)
@@ -0,0 +1,44 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "views/focus/accelerator_handler.h"
+
+#include "views/event.h"
+#include "views/focus/focus_manager.h"
+
+namespace views {
+
+AcceleratorHandler::AcceleratorHandler() {
+}
+
+bool AcceleratorHandler::Dispatch(const MSG& msg) {
+ bool process_message = true;
+
+ if (msg.message >= WM_KEYFIRST && msg.message <= WM_KEYLAST) {
+ FocusManager* focus_manager =
+ FocusManager::GetFocusManagerForNativeView(msg.hwnd);
+ if (focus_manager) {
+ switch (msg.message) {
+ case WM_KEYDOWN:
+ case WM_SYSKEYDOWN: {
+ KeyEvent event(Event::ET_KEY_PRESSED,
+ msg.wParam,
+ msg.lParam & 0xFFFF,
+ (msg.lParam & 0xFFFF0000) >> 16);
+ process_message = focus_manager->OnKeyEvent(event);
+ break;
+ }
+ }
+ }
+ }
+
+ if (process_message) {
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
+
+ return true;
+}
+
+} // namespace views
Property changes on: views/focus/accelerator_handler_win.cc
___________________________________________________________________
Name: svn:eol-style
+ LF
« 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