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

Side by Side Diff: ui/views/view.h

Issue 12207092: views: Dispatch key, touch, scroll and gesture events using the EventDispatch interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge-before-land Created 7 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 | « no previous file | ui/views/view.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef UI_VIEWS_VIEW_H_ 5 #ifndef UI_VIEWS_VIEW_H_
6 #define UI_VIEWS_VIEW_H_ 6 #define UI_VIEWS_VIEW_H_
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 class DragController; 66 class DragController;
67 class FocusBorder; 67 class FocusBorder;
68 class FocusManager; 68 class FocusManager;
69 class FocusTraversable; 69 class FocusTraversable;
70 class InputMethod; 70 class InputMethod;
71 class LayoutManager; 71 class LayoutManager;
72 class ScrollView; 72 class ScrollView;
73 class Widget; 73 class Widget;
74 74
75 namespace internal { 75 namespace internal {
76 class PostEventDispatchHandler;
76 class RootView; 77 class RootView;
77 } 78 }
78 79
79 ///////////////////////////////////////////////////////////////////////////// 80 /////////////////////////////////////////////////////////////////////////////
80 // 81 //
81 // View class 82 // View class
82 // 83 //
83 // A View is a rectangle within the views View hierarchy. It is the base 84 // A View is a rectangle within the views View hierarchy. It is the base
84 // class for all Views. 85 // class for all Views.
85 // 86 //
(...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after
1121 virtual std::string PrintViewGraph(bool first); 1122 virtual std::string PrintViewGraph(bool first);
1122 1123
1123 // Some classes may own an object which contains the children to displayed in 1124 // Some classes may own an object which contains the children to displayed in
1124 // the views hierarchy. The above function gives the class the flexibility to 1125 // the views hierarchy. The above function gives the class the flexibility to
1125 // decide which object should be used to obtain the children, but this 1126 // decide which object should be used to obtain the children, but this
1126 // function makes the decision explicit. 1127 // function makes the decision explicit.
1127 std::string DoPrintViewGraph(bool first, View* view_with_children); 1128 std::string DoPrintViewGraph(bool first, View* view_with_children);
1128 #endif 1129 #endif
1129 1130
1130 private: 1131 private:
1132 friend class internal::PostEventDispatchHandler;
1131 friend class internal::RootView; 1133 friend class internal::RootView;
1132 friend class FocusManager; 1134 friend class FocusManager;
1133 friend class Widget; 1135 friend class Widget;
1134 1136
1135 // Used to track a drag. RootView passes this into 1137 // Used to track a drag. RootView passes this into
1136 // ProcessMousePressed/Dragged. 1138 // ProcessMousePressed/Dragged.
1137 struct DragInfo { 1139 struct DragInfo {
1138 // Sets possible_drag to false and start_x/y to 0. This is invoked by 1140 // Sets possible_drag to false and start_x/y to 0. This is invoked by
1139 // RootView prior to invoke ProcessMousePressed. 1141 // RootView prior to invoke ProcessMousePressed.
1140 void Reset(); 1142 void Reset();
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
1289 void DestroyLayer(); 1291 void DestroyLayer();
1290 1292
1291 // Input --------------------------------------------------------------------- 1293 // Input ---------------------------------------------------------------------
1292 1294
1293 // RootView invokes these. These in turn invoke the appropriate OnMouseXXX 1295 // RootView invokes these. These in turn invoke the appropriate OnMouseXXX
1294 // method. If a drag is detected, DoDrag is invoked. 1296 // method. If a drag is detected, DoDrag is invoked.
1295 bool ProcessMousePressed(const ui::MouseEvent& event, DragInfo* drop_info); 1297 bool ProcessMousePressed(const ui::MouseEvent& event, DragInfo* drop_info);
1296 bool ProcessMouseDragged(const ui::MouseEvent& event, DragInfo* drop_info); 1298 bool ProcessMouseDragged(const ui::MouseEvent& event, DragInfo* drop_info);
1297 void ProcessMouseReleased(const ui::MouseEvent& event); 1299 void ProcessMouseReleased(const ui::MouseEvent& event);
1298 1300
1299 // RootView will invoke this with incoming TouchEvents.
1300 void ProcessTouchEvent(ui::TouchEvent* event);
1301
1302 // RootView will invoke this with incoming GestureEvents. This invokes
1303 // OnGestureEvent.
1304 void ProcessGestureEvent(ui::GestureEvent* event);
1305
1306 // Accelerators -------------------------------------------------------------- 1301 // Accelerators --------------------------------------------------------------
1307 1302
1308 // Registers this view's keyboard accelerators that are not registered to 1303 // Registers this view's keyboard accelerators that are not registered to
1309 // FocusManager yet, if possible. 1304 // FocusManager yet, if possible.
1310 void RegisterPendingAccelerators(); 1305 void RegisterPendingAccelerators();
1311 1306
1312 // Unregisters all the keyboard accelerators associated with this view. 1307 // Unregisters all the keyboard accelerators associated with this view.
1313 // |leave_data_intact| if true does not remove data from accelerators_ array, 1308 // |leave_data_intact| if true does not remove data from accelerators_ array,
1314 // so it could be re-registered with other focus manager 1309 // so it could be re-registered with other focus manager
1315 void UnregisterAccelerators(bool leave_data_intact); 1310 void UnregisterAccelerators(bool leave_data_intact);
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
1478 1473
1479 // Context menus ------------------------------------------------------------- 1474 // Context menus -------------------------------------------------------------
1480 1475
1481 // The menu controller. 1476 // The menu controller.
1482 ContextMenuController* context_menu_controller_; 1477 ContextMenuController* context_menu_controller_;
1483 1478
1484 // Drag and drop ------------------------------------------------------------- 1479 // Drag and drop -------------------------------------------------------------
1485 1480
1486 DragController* drag_controller_; 1481 DragController* drag_controller_;
1487 1482
1483 // Input --------------------------------------------------------------------
1484
1485 scoped_ptr<internal::PostEventDispatchHandler> post_dispatch_handler_;
1486
1488 // Accessibility ------------------------------------------------------------- 1487 // Accessibility -------------------------------------------------------------
1489 1488
1490 // The Windows-specific accessibility implementation for this view. 1489 // The Windows-specific accessibility implementation for this view.
1491 #if defined(OS_WIN) 1490 #if defined(OS_WIN)
1492 base::win::ScopedComPtr<NativeViewAccessibilityWin> 1491 base::win::ScopedComPtr<NativeViewAccessibilityWin>
1493 native_view_accessibility_win_; 1492 native_view_accessibility_win_;
1494 #endif 1493 #endif
1495 1494
1496 DISALLOW_COPY_AND_ASSIGN(View); 1495 DISALLOW_COPY_AND_ASSIGN(View);
1497 }; 1496 };
1498 1497
1499 } // namespace views 1498 } // namespace views
1500 1499
1501 #endif // UI_VIEWS_VIEW_H_ 1500 #endif // UI_VIEWS_VIEW_H_
OLDNEW
« no previous file with comments | « no previous file | ui/views/view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698