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

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

Issue 481433006: Support targeting for gestures in ViewTargeter (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: whitespace Created 6 years, 3 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
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"
11 #include "ui/events/event_processor.h" 11 #include "ui/events/event_processor.h"
12 #include "ui/views/focus/focus_manager.h" 12 #include "ui/views/focus/focus_manager.h"
13 #include "ui/views/focus/focus_search.h" 13 #include "ui/views/focus/focus_search.h"
14 #include "ui/views/view.h" 14 #include "ui/views/view.h"
15 #include "ui/views/view_targeter_delegate.h" 15 #include "ui/views/view_targeter_delegate.h"
16 16
17 namespace views { 17 namespace views {
18 18
19 namespace test { 19 namespace test {
20 class ViewTargeterTest;
20 class WidgetTest; 21 class WidgetTest;
21 } 22 }
22 23
24 class ViewTargeter;
23 class Widget; 25 class Widget;
24 26
25 // This is a views-internal API and should not be used externally. 27 // This is a views-internal API and should not be used externally.
26 // Widget exposes this object as a View*. 28 // Widget exposes this object as a View*.
27 namespace internal { 29 namespace internal {
28 class PreEventDispatchHandler; 30 class PreEventDispatchHandler;
29 31
30 //////////////////////////////////////////////////////////////////////////////// 32 ////////////////////////////////////////////////////////////////////////////////
31 // RootView class 33 // RootView class
32 // 34 //
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 virtual void ViewHierarchyChanged( 118 virtual void ViewHierarchyChanged(
117 const ViewHierarchyChangedDetails& details) OVERRIDE; 119 const ViewHierarchyChangedDetails& details) OVERRIDE;
118 virtual void VisibilityChanged(View* starting_from, bool is_visible) OVERRIDE; 120 virtual void VisibilityChanged(View* starting_from, bool is_visible) OVERRIDE;
119 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; 121 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
120 virtual gfx::Vector2d CalculateOffsetToAncestorWithLayer( 122 virtual gfx::Vector2d CalculateOffsetToAncestorWithLayer(
121 ui::Layer** layer_parent) OVERRIDE; 123 ui::Layer** layer_parent) OVERRIDE;
122 virtual View::DragInfo* GetDragInfo() OVERRIDE; 124 virtual View::DragInfo* GetDragInfo() OVERRIDE;
123 125
124 private: 126 private:
125 friend class ::views::View; 127 friend class ::views::View;
128 friend class ::views::ViewTargeter;
126 friend class ::views::Widget; 129 friend class ::views::Widget;
130 friend class ::views::test::ViewTargeterTest;
127 friend class ::views::test::WidgetTest; 131 friend class ::views::test::WidgetTest;
128 132
129 // Input --------------------------------------------------------------------- 133 // Input ---------------------------------------------------------------------
130 134
131 // TODO(tdanderson): Remove RootView::DispatchGestureEvent() once 135 // TODO(tdanderson): Remove RootView::DispatchGestureEvent() once
132 // its targeting and dispatch logic has been moved 136 // its targeting and dispatch logic has been moved
133 // elsewhere. See crbug.com/348083. 137 // elsewhere. See crbug.com/348083.
134 void DispatchGestureEvent(ui::GestureEvent* event); 138 void DispatchGestureEvent(ui::GestureEvent* event);
135 139
136 // Update the cursor given a mouse event. This is called by non mouse_move 140 // Update the cursor given a mouse event. This is called by non mouse_move
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 184
181 // true if mouse_pressed_handler_ has been explicitly set 185 // true if mouse_pressed_handler_ has been explicitly set
182 bool explicit_mouse_handler_; 186 bool explicit_mouse_handler_;
183 187
184 // Last position/flag of a mouse press/drag. Used if capture stops and we need 188 // Last position/flag of a mouse press/drag. Used if capture stops and we need
185 // to synthesize a release. 189 // to synthesize a release.
186 int last_mouse_event_flags_; 190 int last_mouse_event_flags_;
187 int last_mouse_event_x_; 191 int last_mouse_event_x_;
188 int last_mouse_event_y_; 192 int last_mouse_event_y_;
189 193
190 // The view currently handling gesture events. When set, this handler receives 194 // The View currently handling gesture events.
191 // all gesture events.
192 View* gesture_handler_; 195 View* gesture_handler_;
193 196
197 // If true, then gesture events received from Widget should be dispatched to
198 // |gesture_handler_|.
199 bool dispatch_to_gesture_handler_;
sadrul 2014/08/26 16:21:44 Is the main purpose here to stop the bubbling of t
tdanderson 2014/08/26 20:21:15 Yes, that's pretty much the purpose of it. Changed
200
194 scoped_ptr<internal::PreEventDispatchHandler> pre_dispatch_handler_; 201 scoped_ptr<internal::PreEventDispatchHandler> pre_dispatch_handler_;
195 scoped_ptr<internal::PostEventDispatchHandler> post_dispatch_handler_; 202 scoped_ptr<internal::PostEventDispatchHandler> post_dispatch_handler_;
196 203
197 // Focus --------------------------------------------------------------------- 204 // Focus ---------------------------------------------------------------------
198 205
199 // The focus search algorithm. 206 // The focus search algorithm.
200 FocusSearch focus_search_; 207 FocusSearch focus_search_;
201 208
202 // Whether this root view belongs to the current active window. 209 // Whether this root view belongs to the current active window.
203 // bool activated_; 210 // bool activated_;
(...skipping 13 matching lines...) Expand all
217 // Tracks drag state for a view. 224 // Tracks drag state for a view.
218 View::DragInfo drag_info_; 225 View::DragInfo drag_info_;
219 226
220 DISALLOW_IMPLICIT_CONSTRUCTORS(RootView); 227 DISALLOW_IMPLICIT_CONSTRUCTORS(RootView);
221 }; 228 };
222 229
223 } // namespace internal 230 } // namespace internal
224 } // namespace views 231 } // namespace views
225 232
226 #endif // UI_VIEWS_WIDGET_ROOT_VIEW_H_ 233 #endif // UI_VIEWS_WIDGET_ROOT_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698