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

Side by Side Diff: chrome/browser/views/unhandled_keyboard_event_handler.cc

Issue 3354005: Re-lands 58186: (Closed)
Patch Set: Created 10 years, 3 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
« no previous file with comments | « chrome/browser/views/toolbar_view.cc ('k') | chrome/browser/views/url_picker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/views/unhandled_keyboard_event_handler.h" 5 #include "chrome/browser/views/unhandled_keyboard_event_handler.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "views/focus/focus_manager.h" 8 #include "views/focus/focus_manager.h"
9 9
10 UnhandledKeyboardEventHandler::UnhandledKeyboardEventHandler() { 10 UnhandledKeyboardEventHandler::UnhandledKeyboardEventHandler() {
(...skipping 20 matching lines...) Expand all
31 ignore_next_char_event_ = false; 31 ignore_next_char_event_ = false;
32 return; 32 return;
33 } 33 }
34 // It's necessary to reset this flag, because a RawKeyDown event may not 34 // It's necessary to reset this flag, because a RawKeyDown event may not
35 // always generate a Char event. 35 // always generate a Char event.
36 ignore_next_char_event_ = false; 36 ignore_next_char_event_ = false;
37 #endif 37 #endif
38 38
39 if (event.type == WebKit::WebInputEvent::RawKeyDown) { 39 if (event.type == WebKit::WebInputEvent::RawKeyDown) {
40 views::Accelerator accelerator( 40 views::Accelerator accelerator(
41 static_cast<base::KeyboardCode>(event.windowsKeyCode), 41 static_cast<app::KeyboardCode>(event.windowsKeyCode),
42 (event.modifiers & NativeWebKeyboardEvent::ShiftKey) == 42 (event.modifiers & NativeWebKeyboardEvent::ShiftKey) ==
43 NativeWebKeyboardEvent::ShiftKey, 43 NativeWebKeyboardEvent::ShiftKey,
44 (event.modifiers & NativeWebKeyboardEvent::ControlKey) == 44 (event.modifiers & NativeWebKeyboardEvent::ControlKey) ==
45 NativeWebKeyboardEvent::ControlKey, 45 NativeWebKeyboardEvent::ControlKey,
46 (event.modifiers & NativeWebKeyboardEvent::AltKey) == 46 (event.modifiers & NativeWebKeyboardEvent::AltKey) ==
47 NativeWebKeyboardEvent::AltKey); 47 NativeWebKeyboardEvent::AltKey);
48 48
49 #if defined(OS_WIN) 49 #if defined(OS_WIN)
50 // This is tricky: we want to set ignore_next_char_event_ if 50 // This is tricky: we want to set ignore_next_char_event_ if
51 // ProcessAccelerator returns true. But ProcessAccelerator might delete 51 // ProcessAccelerator returns true. But ProcessAccelerator might delete
(...skipping 14 matching lines...) Expand all
66 } 66 }
67 67
68 #if defined(OS_WIN) 68 #if defined(OS_WIN)
69 // Any unhandled keyboard/character messages should be defproced. 69 // Any unhandled keyboard/character messages should be defproced.
70 // This allows stuff like F10, etc to work correctly. 70 // This allows stuff like F10, etc to work correctly.
71 DefWindowProc(event.os_event.hwnd, event.os_event.message, 71 DefWindowProc(event.os_event.hwnd, event.os_event.message,
72 event.os_event.wParam, event.os_event.lParam); 72 event.os_event.wParam, event.os_event.lParam);
73 #endif 73 #endif
74 } 74 }
75 75
OLDNEW
« no previous file with comments | « chrome/browser/views/toolbar_view.cc ('k') | chrome/browser/views/url_picker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698