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

Side by Side Diff: ui/wm/core/nested_accelerator_dispatcher_linux.cc

Issue 404203003: Distinguish between keystroke and character events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: IsCharFromNative() for Mac build Created 6 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ui/wm/core/nested_accelerator_dispatcher.h" 5 #include "ui/wm/core/nested_accelerator_dispatcher.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "ui/base/accelerators/accelerator.h" 9 #include "ui/base/accelerators/accelerator.h"
10 #include "ui/events/event.h" 10 #include "ui/events/event.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 return scoped_ptr<base::RunLoop>(new base::RunLoop()); 59 return scoped_ptr<base::RunLoop>(new base::RunLoop());
60 } 60 }
61 61
62 // ui::PlatformEventDispatcher: 62 // ui::PlatformEventDispatcher:
63 virtual bool CanDispatchEvent(const ui::PlatformEvent& event) OVERRIDE { 63 virtual bool CanDispatchEvent(const ui::PlatformEvent& event) OVERRIDE {
64 return true; 64 return true;
65 } 65 }
66 66
67 virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) OVERRIDE { 67 virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) OVERRIDE {
68 if (IsKeyEvent(event)) { 68 if (IsKeyEvent(event)) {
69 ui::KeyEvent key_event(event, false); 69 ui::KeyEvent key_event(event);
70 ui::Accelerator accelerator = CreateAcceleratorFromKeyEvent(key_event); 70 ui::Accelerator accelerator = CreateAcceleratorFromKeyEvent(key_event);
71 71
72 switch (delegate_->ProcessAccelerator(accelerator)) { 72 switch (delegate_->ProcessAccelerator(accelerator)) {
73 case NestedAcceleratorDelegate::RESULT_PROCESS_LATER: 73 case NestedAcceleratorDelegate::RESULT_PROCESS_LATER:
74 #if defined(USE_X11) 74 #if defined(USE_X11)
75 XPutBackEvent(event->xany.display, event); 75 XPutBackEvent(event->xany.display, event);
76 #else 76 #else
77 NOTIMPLEMENTED(); 77 NOTIMPLEMENTED();
78 #endif 78 #endif
79 return ui::POST_DISPATCH_NONE; 79 return ui::POST_DISPATCH_NONE;
(...skipping 15 matching lines...) Expand all
95 }; 95 };
96 96
97 scoped_ptr<NestedAcceleratorDispatcher> NestedAcceleratorDispatcher::Create( 97 scoped_ptr<NestedAcceleratorDispatcher> NestedAcceleratorDispatcher::Create(
98 NestedAcceleratorDelegate* delegate, 98 NestedAcceleratorDelegate* delegate,
99 base::MessagePumpDispatcher* nested_dispatcher) { 99 base::MessagePumpDispatcher* nested_dispatcher) {
100 return scoped_ptr<NestedAcceleratorDispatcher>( 100 return scoped_ptr<NestedAcceleratorDispatcher>(
101 new NestedAcceleratorDispatcherLinux(delegate)); 101 new NestedAcceleratorDispatcherLinux(delegate));
102 } 102 }
103 103
104 } // namespace wm 104 } // namespace wm
OLDNEW
« no previous file with comments | « ui/wm/core/input_method_event_filter_unittest.cc ('k') | ui/wm/core/nested_accelerator_dispatcher_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698