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

Unified Diff: ui/views/view.h

Issue 12302005: views: Start sending mouse events using the EventDispatch interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/views/view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/view.h
diff --git a/ui/views/view.h b/ui/views/view.h
index 2698d6da7f2d316d63df88181e94220a2d0026d4..6d466b3696beef4513e3460cbf9fa50a2e10cff6 100644
--- a/ui/views/view.h
+++ b/ui/views/view.h
@@ -906,6 +906,25 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
bool is_horizontal, bool is_positive);
protected:
+ // Used to track a drag. RootView passes this into
+ // ProcessMousePressed/Dragged.
+ struct DragInfo {
+ // Sets possible_drag to false and start_x/y to 0. This is invoked by
+ // RootView prior to invoke ProcessMousePressed.
+ void Reset();
+
+ // Sets possible_drag to true and start_pt to the specified point.
+ // This is invoked by the target view if it detects the press may generate
+ // a drag.
+ void PossibleDrag(const gfx::Point& p);
+
+ // Whether the press may generate a drag.
+ bool possible_drag;
+
+ // Coordinates of the mouse press.
+ gfx::Point start_pt;
+ };
+
// Size and disposition ------------------------------------------------------
// Override to be notified when the bounds of the view have changed.
@@ -1050,6 +1069,8 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
// Subclasses override to provide custom shaped hit test regions.
virtual void GetHitTestMask(gfx::Path* mask) const;
+ virtual DragInfo* GetDragInfo();
+
// Focus ---------------------------------------------------------------------
// Override to be notified when focus has changed either to or from this View.
@@ -1134,25 +1155,6 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
friend class FocusManager;
friend class Widget;
- // Used to track a drag. RootView passes this into
- // ProcessMousePressed/Dragged.
- struct DragInfo {
- // Sets possible_drag to false and start_x/y to 0. This is invoked by
- // RootView prior to invoke ProcessMousePressed.
- void Reset();
-
- // Sets possible_drag to true and start_pt to the specified point.
- // This is invoked by the target view if it detects the press may generate
- // a drag.
- void PossibleDrag(const gfx::Point& p);
-
- // Whether the press may generate a drag.
- bool possible_drag;
-
- // Coordinates of the mouse press.
- gfx::Point start_pt;
- };
-
// Painting -----------------------------------------------------------------
enum SchedulePaintType {
@@ -1292,10 +1294,8 @@ class VIEWS_EXPORT View : public ui::LayerDelegate,
// Input ---------------------------------------------------------------------
- // RootView invokes these. These in turn invoke the appropriate OnMouseXXX
- // method. If a drag is detected, DoDrag is invoked.
- bool ProcessMousePressed(const ui::MouseEvent& event, DragInfo* drop_info);
- bool ProcessMouseDragged(const ui::MouseEvent& event, DragInfo* drop_info);
+ bool ProcessMousePressed(const ui::MouseEvent& event);
+ bool ProcessMouseDragged(const ui::MouseEvent& event);
void ProcessMouseReleased(const ui::MouseEvent& event);
// Accelerators --------------------------------------------------------------
« 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