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

Side by Side Diff: ui/views/widget/root_view.h

Issue 12212117: views: Dispatch mouse events using EventDispatch interface too. (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/views/view.cc ('k') | ui/views/widget/root_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_WIDGET_ROOT_VIEW_H_ 5 #ifndef UI_VIEWS_WIDGET_ROOT_VIEW_H_
6 #define UI_VIEWS_WIDGET_ROOT_VIEW_H_ 6 #define UI_VIEWS_WIDGET_ROOT_VIEW_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; 110 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
111 virtual void ReorderChildLayers(ui::Layer* parent_layer) OVERRIDE; 111 virtual void ReorderChildLayers(ui::Layer* parent_layer) OVERRIDE;
112 112
113 protected: 113 protected:
114 // Overridden from View: 114 // Overridden from View:
115 virtual void ViewHierarchyChanged(bool is_add, View* parent, 115 virtual void ViewHierarchyChanged(bool is_add, View* parent,
116 View* child) OVERRIDE; 116 View* child) OVERRIDE;
117 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; 117 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
118 virtual gfx::Vector2d CalculateOffsetToAncestorWithLayer( 118 virtual gfx::Vector2d CalculateOffsetToAncestorWithLayer(
119 ui::Layer** layer_parent) OVERRIDE; 119 ui::Layer** layer_parent) OVERRIDE;
120 virtual View::DragInfo* GetDragInfo() OVERRIDE;
120 121
121 private: 122 private:
122 friend class View; 123 friend class View;
123 friend class Widget; 124 friend class Widget;
124 125
125 // Input --------------------------------------------------------------------- 126 // Input ---------------------------------------------------------------------
126 127
127 // Update the cursor given a mouse event. This is called by non mouse_move 128 // Update the cursor given a mouse event. This is called by non mouse_move
128 // event handlers to honor the cursor desired by views located under the 129 // event handlers to honor the cursor desired by views located under the
129 // cursor during drag operations. The location of the mouse should be in the 130 // cursor during drag operations. The location of the mouse should be in the
130 // current coordinate system (i.e. any necessary transformation should be 131 // current coordinate system (i.e. any necessary transformation should be
131 // applied to the point prior to calling this). 132 // applied to the point prior to calling this).
132 void UpdateCursor(const ui::MouseEvent& event); 133 void UpdateCursor(const ui::MouseEvent& event);
133 134
134 // Updates the last_mouse_* fields from e. The location of the mouse should be 135 // Updates the last_mouse_* fields from e. The location of the mouse should be
135 // in the current coordinate system (i.e. any necessary transformation should 136 // in the current coordinate system (i.e. any necessary transformation should
136 // be applied to the point prior to calling this). 137 // be applied to the point prior to calling this).
137 void SetMouseLocationAndFlags(const ui::MouseEvent& event); 138 void SetMouseLocationAndFlags(const ui::MouseEvent& event);
138 139
139 void DispatchEventToTarget(View* target, ui::Event* event); 140 void DispatchEventToTarget(View* target, ui::Event* event);
140 141
142 // |view| is the view receiving |event|. This function sends the event to all
143 // the Views up the hierarchy that has |notify_enter_exit_on_child_| flag
144 // turned on, but does not contain |sibling|.
145 void NotifyEnterExitOfDescendant(const ui::MouseEvent& event,
146 ui::EventType type,
147 View* view,
148 View* sibling);
149
141 // Overridden from ui::EventDispatcherDelegate: 150 // Overridden from ui::EventDispatcherDelegate:
142 virtual bool CanDispatchToTarget(ui::EventTarget* target) OVERRIDE; 151 virtual bool CanDispatchToTarget(ui::EventTarget* target) OVERRIDE;
143 152
144 ////////////////////////////////////////////////////////////////////////////// 153 //////////////////////////////////////////////////////////////////////////////
145 154
146 // Tree operations ----------------------------------------------------------- 155 // Tree operations -----------------------------------------------------------
147 156
148 // The host Widget 157 // The host Widget
149 Widget* widget_; 158 Widget* widget_;
150 159
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 // Tracks drag state for a view. 211 // Tracks drag state for a view.
203 View::DragInfo drag_info_; 212 View::DragInfo drag_info_;
204 213
205 DISALLOW_IMPLICIT_CONSTRUCTORS(RootView); 214 DISALLOW_IMPLICIT_CONSTRUCTORS(RootView);
206 }; 215 };
207 216
208 } // namespace internal 217 } // namespace internal
209 } // namespace views 218 } // namespace views
210 219
211 #endif // UI_VIEWS_WIDGET_ROOT_VIEW_H_ 220 #endif // UI_VIEWS_WIDGET_ROOT_VIEW_H_
OLDNEW
« no previous file with comments | « ui/views/view.cc ('k') | ui/views/widget/root_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698