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

Side by Side Diff: views/focus/accelerator_handler_touch.cc

Issue 6823055: Consolidate OnKeyEvent and InputMethod code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Restore IME call in accelerator_handler_touch.cc. Created 9 years, 8 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/ime/input_method_gtk.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "views/focus/accelerator_handler.h" 5 #include "views/focus/accelerator_handler.h"
6 6
7 #include <bitset> 7 #include <bitset>
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #if defined(HAVE_XINPUT2) 9 #if defined(HAVE_XINPUT2)
10 #include <X11/extensions/XInput2.h> 10 #include <X11/extensions/XInput2.h>
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 case KeyRelease: { 179 case KeyRelease: {
180 Event::FromNativeEvent2 from_native; 180 Event::FromNativeEvent2 from_native;
181 KeyEvent keyev(xev, from_native); 181 KeyEvent keyev(xev, from_native);
182 InputMethod* ime = widget->GetInputMethod(); 182 InputMethod* ime = widget->GetInputMethod();
183 // Always dispatch key events to the input method first, to make sure 183 // Always dispatch key events to the input method first, to make sure
184 // that the input method's hotkeys work all time. 184 // that the input method's hotkeys work all time.
185 if (ime) { 185 if (ime) {
186 ime->DispatchKeyEvent(keyev); 186 ime->DispatchKeyEvent(keyev);
187 return true; 187 return true;
188 } 188 }
189 return root->ProcessKeyEvent(keyev); 189 return widget->OnKeyEvent(keyev);
190 } 190 }
191 191
192 case ButtonPress: 192 case ButtonPress:
193 case ButtonRelease: { 193 case ButtonRelease: {
194 if (xev->xbutton.button == 4 || xev->xbutton.button == 5) { 194 if (xev->xbutton.button == 4 || xev->xbutton.button == 5) {
195 // Scrolling the wheel triggers button press/release events. 195 // Scrolling the wheel triggers button press/release events.
196 Event::FromNativeEvent2 from_native; 196 Event::FromNativeEvent2 from_native;
197 MouseWheelEvent wheelev(xev, from_native); 197 MouseWheelEvent wheelev(xev, from_native);
198 return root->OnMouseWheel(wheelev); 198 return root->OnMouseWheel(wheelev);
199 } else { 199 } else {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 } 245 }
246 246
247 base::MessagePumpGlibXDispatcher::DispatchStatus 247 base::MessagePumpGlibXDispatcher::DispatchStatus
248 AcceleratorHandler::DispatchX(XEvent* xev) { 248 AcceleratorHandler::DispatchX(XEvent* xev) {
249 return DispatchXEvent(xev) ? 249 return DispatchXEvent(xev) ?
250 base::MessagePumpGlibXDispatcher::EVENT_PROCESSED : 250 base::MessagePumpGlibXDispatcher::EVENT_PROCESSED :
251 base::MessagePumpGlibXDispatcher::EVENT_IGNORED; 251 base::MessagePumpGlibXDispatcher::EVENT_IGNORED;
252 } 252 }
253 253
254 } // namespace views 254 } // namespace views
OLDNEW
« no previous file with comments | « views/focus/accelerator_handler_gtk.cc ('k') | views/ime/input_method_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698