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

Side by Side Diff: views/touchui/gesture_manager.cc

Issue 7942004: Consolidate/cleanup event cracking code; single out GdkEvents. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge removal of compact nav. Created 9 years, 2 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/native_types.h ('k') | views/touchui/touch_factory.h » ('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/touchui/gesture_manager.h" 5 #include "views/touchui/gesture_manager.h"
6 #ifndef NDEBUG 6 #ifndef NDEBUG
7 #include <ostream> 7 #include <ostream>
8 #endif 8 #endif
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 18 matching lines...) Expand all
29 return false; // The event was consumed by a touch sequence. 29 return false; // The event was consumed by a touch sequence.
30 30
31 // TODO(rjkroege): A realistic version of the GestureManager will 31 // TODO(rjkroege): A realistic version of the GestureManager will
32 // appear in a subsequent CL. This interim version permits verifying that the 32 // appear in a subsequent CL. This interim version permits verifying that the
33 // event distribution code works by turning all touch inputs into 33 // event distribution code works by turning all touch inputs into
34 // mouse approximations. 34 // mouse approximations.
35 35
36 // Conver the touch-event into a mouse-event. This mouse-event gets its 36 // Conver the touch-event into a mouse-event. This mouse-event gets its
37 // location information from the native-event, so it needs to convert the 37 // location information from the native-event, so it needs to convert the
38 // coordinate to the target widget. 38 // coordinate to the target widget.
39 Event::FromNativeEvent2 from_native; 39 MouseEvent mouseev(event);
40 MouseEvent mouseev(event, from_native);
41 if (ViewsDelegate::views_delegate->GetDefaultParentView()) { 40 if (ViewsDelegate::views_delegate->GetDefaultParentView()) {
42 // TODO(oshima): We may need to send the event back through 41 // TODO(oshima): We may need to send the event back through
43 // window manager to handle mouse capture correctly. 42 // window manager to handle mouse capture correctly.
44 Widget* desktop = 43 Widget* desktop =
45 ViewsDelegate::views_delegate->GetDefaultParentView()->GetWidget(); 44 ViewsDelegate::views_delegate->GetDefaultParentView()->GetWidget();
46 Widget* source_widget = source->GetWidget(); 45 Widget* source_widget = source->GetWidget();
47 MouseEvent converted( 46 MouseEvent converted(
48 mouseev, desktop->GetRootView(), source_widget->GetRootView()); 47 mouseev, desktop->GetRootView(), source_widget->GetRootView());
49 source_widget->OnMouseEvent(converted); 48 source_widget->OnMouseEvent(converted);
50 } else { 49 } else {
(...skipping 10 matching lines...) Expand all
61 source_widget->OnMouseEvent(mouseev); 60 source_widget->OnMouseEvent(mouseev);
62 } 61 }
63 } 62 }
64 return true; 63 return true;
65 } 64 }
66 65
67 GestureManager::GestureManager() { 66 GestureManager::GestureManager() {
68 } 67 }
69 68
70 } // namespace views 69 } // namespace views
OLDNEW
« no previous file with comments | « views/native_types.h ('k') | views/touchui/touch_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698