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

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

Issue 6685069: Disambiguate OnMouseCaptureLost from OnMouseReleased, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments, fix tests, cleanup, etc. Created 9 years, 9 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/controls/textfield/native_textfield_views.cc ('k') | views/touchui/gesture_manager.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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 break; 123 break;
124 } 124 }
125 TouchFactory::GetInstance()->SetCursorVisible(true, start_timer); 125 TouchFactory::GetInstance()->SetCursorVisible(true, start_timer);
126 } 126 }
127 127
128 // Dispatch the event. 128 // Dispatch the event.
129 switch (cookie->evtype) { 129 switch (cookie->evtype) {
130 case XI_ButtonPress: 130 case XI_ButtonPress:
131 return root->OnMousePressed(mouseev); 131 return root->OnMousePressed(mouseev);
132 case XI_ButtonRelease: 132 case XI_ButtonRelease:
133 root->OnMouseReleased(mouseev, false); 133 root->OnMouseReleased(mouseev);
134 return true; 134 return true;
135 case XI_Motion: { 135 case XI_Motion: {
136 if (mouseev.type() == ui::ET_MOUSE_DRAGGED) { 136 if (mouseev.type() == ui::ET_MOUSE_DRAGGED) {
137 return root->OnMouseDragged(mouseev); 137 return root->OnMouseDragged(mouseev);
138 } else { 138 } else {
139 root->OnMouseMoved(mouseev); 139 root->OnMouseMoved(mouseev);
140 return true; 140 return true;
141 } 141 }
142 } 142 }
143 } 143 }
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 // Scrolling the wheel triggers button press/release events. 178 // Scrolling the wheel triggers button press/release events.
179 Event::FromNativeEvent2 from_native; 179 Event::FromNativeEvent2 from_native;
180 MouseWheelEvent wheelev(xev, from_native); 180 MouseWheelEvent wheelev(xev, from_native);
181 return root->OnMouseWheel(wheelev); 181 return root->OnMouseWheel(wheelev);
182 } else { 182 } else {
183 Event::FromNativeEvent2 from_native; 183 Event::FromNativeEvent2 from_native;
184 MouseEvent mouseev(xev, from_native); 184 MouseEvent mouseev(xev, from_native);
185 if (xev->type == ButtonPress) { 185 if (xev->type == ButtonPress) {
186 return root->OnMousePressed(mouseev); 186 return root->OnMousePressed(mouseev);
187 } else { 187 } else {
188 root->OnMouseReleased(mouseev, false); 188 root->OnMouseReleased(mouseev);
189 return true; // Assume the event has been processed to make sure we 189 return true; // Assume the event has been processed to make sure we
190 // don't process it twice. 190 // don't process it twice.
191 } 191 }
192 } 192 }
193 } 193 }
194 194
195 case MotionNotify: { 195 case MotionNotify: {
196 Event::FromNativeEvent2 from_native; 196 Event::FromNativeEvent2 from_native;
197 MouseEvent mouseev(xev, from_native); 197 MouseEvent mouseev(xev, from_native);
198 if (mouseev.type() == ui::ET_MOUSE_DRAGGED) { 198 if (mouseev.type() == ui::ET_MOUSE_DRAGGED) {
(...skipping 29 matching lines...) Expand all
228 } 228 }
229 229
230 base::MessagePumpGlibXDispatcher::DispatchStatus 230 base::MessagePumpGlibXDispatcher::DispatchStatus
231 AcceleratorHandler::DispatchX(XEvent* xev) { 231 AcceleratorHandler::DispatchX(XEvent* xev) {
232 return DispatchXEvent(xev) ? 232 return DispatchXEvent(xev) ?
233 base::MessagePumpGlibXDispatcher::EVENT_PROCESSED : 233 base::MessagePumpGlibXDispatcher::EVENT_PROCESSED :
234 base::MessagePumpGlibXDispatcher::EVENT_IGNORED; 234 base::MessagePumpGlibXDispatcher::EVENT_IGNORED;
235 } 235 }
236 236
237 } // namespace views 237 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/textfield/native_textfield_views.cc ('k') | views/touchui/gesture_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698