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

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

Issue 6487002: Add a new constructor to KeyEvent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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.h ('k') | views/focus/accelerator_handler_win.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 "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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 xwindow = xiev->event; 157 xwindow = xiev->event;
158 } 158 }
159 #endif 159 #endif
160 160
161 GdkWindow* gwind = gdk_window_lookup_for_display(gdisp, xwindow); 161 GdkWindow* gwind = gdk_window_lookup_for_display(gdisp, xwindow);
162 162
163 if (RootView* root = FindRootViewForGdkWindow(gwind)) { 163 if (RootView* root = FindRootViewForGdkWindow(gwind)) {
164 switch (xev->type) { 164 switch (xev->type) {
165 case KeyPress: 165 case KeyPress:
166 case KeyRelease: { 166 case KeyRelease: {
167 KeyEvent keyev(xev); 167 KeyEvent keyev(xev, FromNativeEvent2);
168 return root->ProcessKeyEvent(keyev); 168 return root->ProcessKeyEvent(keyev);
169 } 169 }
170 170
171 case ButtonPress: 171 case ButtonPress:
172 case ButtonRelease: { 172 case ButtonRelease: {
173 if (xev->xbutton.button == 4 || xev->xbutton.button == 5) { 173 if (xev->xbutton.button == 4 || xev->xbutton.button == 5) {
174 // Scrolling the wheel triggers button press/release events. 174 // Scrolling the wheel triggers button press/release events.
175 MouseWheelEvent wheelev(xev); 175 MouseWheelEvent wheelev(xev);
176 return root->ProcessMouseWheelEvent(wheelev); 176 return root->ProcessMouseWheelEvent(wheelev);
177 } else { 177 } else {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 } 221 }
222 222
223 base::MessagePumpGlibXDispatcher::DispatchStatus AcceleratorHandler::Dispatch( 223 base::MessagePumpGlibXDispatcher::DispatchStatus AcceleratorHandler::Dispatch(
224 XEvent* xev) { 224 XEvent* xev) {
225 return DispatchXEvent(xev) ? 225 return DispatchXEvent(xev) ?
226 base::MessagePumpGlibXDispatcher::EVENT_PROCESSED : 226 base::MessagePumpGlibXDispatcher::EVENT_PROCESSED :
227 base::MessagePumpGlibXDispatcher::EVENT_IGNORED; 227 base::MessagePumpGlibXDispatcher::EVENT_IGNORED;
228 } 228 }
229 229
230 } // namespace views 230 } // namespace views
OLDNEW
« no previous file with comments | « views/focus/accelerator_handler.h ('k') | views/focus/accelerator_handler_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698