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

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: Update additional OnEventKey references. 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 172
173 GdkWindow* gwind = gdk_window_lookup_for_display(gdisp, xwindow); 173 GdkWindow* gwind = gdk_window_lookup_for_display(gdisp, xwindow);
174 Widget* widget = FindWidgetForGdkWindow(gwind); 174 Widget* widget = FindWidgetForGdkWindow(gwind);
175 if (widget) { 175 if (widget) {
176 RootView* root = widget->GetRootView(); 176 RootView* root = widget->GetRootView();
177 switch (xev->type) { 177 switch (xev->type) {
178 case KeyPress: 178 case KeyPress:
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 return widget->OnKeyEvent(keyev);
James Su 2011/04/25 03:37:03 This change breaks IME when using hardware keyboar
James Su 2011/04/25 03:46:32 To be more clear: we always need to dispatch a key
msw 2011/04/25 17:52:38 Done. Logic restored with updated call to Widget.
183 // Always dispatch key events to the input method first, to make sure
184 // that the input method's hotkeys work all time.
185 if (ime) {
186 ime->DispatchKeyEvent(keyev);
187 return true;
188 }
189 return root->ProcessKeyEvent(keyev);
190 } 183 }
191 184
192 case ButtonPress: 185 case ButtonPress:
193 case ButtonRelease: { 186 case ButtonRelease: {
194 if (xev->xbutton.button == 4 || xev->xbutton.button == 5) { 187 if (xev->xbutton.button == 4 || xev->xbutton.button == 5) {
195 // Scrolling the wheel triggers button press/release events. 188 // Scrolling the wheel triggers button press/release events.
196 Event::FromNativeEvent2 from_native; 189 Event::FromNativeEvent2 from_native;
197 MouseWheelEvent wheelev(xev, from_native); 190 MouseWheelEvent wheelev(xev, from_native);
198 return root->OnMouseWheel(wheelev); 191 return root->OnMouseWheel(wheelev);
199 } else { 192 } else {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 } 238 }
246 239
247 base::MessagePumpGlibXDispatcher::DispatchStatus 240 base::MessagePumpGlibXDispatcher::DispatchStatus
248 AcceleratorHandler::DispatchX(XEvent* xev) { 241 AcceleratorHandler::DispatchX(XEvent* xev) {
249 return DispatchXEvent(xev) ? 242 return DispatchXEvent(xev) ?
250 base::MessagePumpGlibXDispatcher::EVENT_PROCESSED : 243 base::MessagePumpGlibXDispatcher::EVENT_PROCESSED :
251 base::MessagePumpGlibXDispatcher::EVENT_IGNORED; 244 base::MessagePumpGlibXDispatcher::EVENT_IGNORED;
252 } 245 }
253 246
254 } // namespace views 247 } // 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