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

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

Issue 8364039: Initial views touchui GestureRecognizer support (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Wired gesture events into RootView and commandline switch enable-gesture Created 9 years, 1 month 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) 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 #ifndef VIEWS_WIDGET_ROOT_VIEW_H_ 5 #ifndef VIEWS_WIDGET_ROOT_VIEW_H_
6 #define VIEWS_WIDGET_ROOT_VIEW_H_ 6 #define VIEWS_WIDGET_ROOT_VIEW_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "views/focus/focus_manager.h" 12 #include "views/focus/focus_manager.h"
13 #include "views/focus/focus_search.h" 13 #include "views/focus/focus_search.h"
14 #include "views/touchui/gesture_recognizer.h"
14 #include "views/view.h" 15 #include "views/view.h"
15 16
16 namespace ui { 17 namespace ui {
17 enum TouchStatus; 18 enum TouchStatus;
18 } 19 }
19 20
20 namespace views { 21 namespace views {
21 22
22 class Widget; 23 class Widget;
23 class GestureManager; 24 class GestureManager;
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 virtual bool OnMouseDragged(const MouseEvent& event) OVERRIDE; 107 virtual bool OnMouseDragged(const MouseEvent& event) OVERRIDE;
107 virtual void OnMouseReleased(const MouseEvent& event) OVERRIDE; 108 virtual void OnMouseReleased(const MouseEvent& event) OVERRIDE;
108 virtual void OnMouseCaptureLost() OVERRIDE; 109 virtual void OnMouseCaptureLost() OVERRIDE;
109 virtual void OnMouseMoved(const MouseEvent& event) OVERRIDE; 110 virtual void OnMouseMoved(const MouseEvent& event) OVERRIDE;
110 virtual void OnMouseExited(const MouseEvent& event) OVERRIDE; 111 virtual void OnMouseExited(const MouseEvent& event) OVERRIDE;
111 virtual bool OnMouseWheel(const MouseWheelEvent& event) OVERRIDE; 112 virtual bool OnMouseWheel(const MouseWheelEvent& event) OVERRIDE;
112 virtual ui::TouchStatus OnTouchEvent(const TouchEvent& event) OVERRIDE; 113 virtual ui::TouchStatus OnTouchEvent(const TouchEvent& event) OVERRIDE;
113 virtual void SetMouseHandler(View* new_mouse_handler) OVERRIDE; 114 virtual void SetMouseHandler(View* new_mouse_handler) OVERRIDE;
114 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; 115 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
115 116
117 // GestureManager invokes for recognized GestureEvents.
118 // Identify gesture handler view and passes the gesture events, returns true
119 // if gesture handler consumes else false.
120 bool ForwardGestureEvents(GestureRecognizer::Gestures* gestures);
121
116 protected: 122 protected:
117 // Overridden from View: 123 // Overridden from View:
118 virtual void ViewHierarchyChanged(bool is_add, View* parent, 124 virtual void ViewHierarchyChanged(bool is_add, View* parent,
119 View* child) OVERRIDE; 125 View* child) OVERRIDE;
120 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; 126 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
121 virtual void CalculateOffsetToAncestorWithLayer( 127 virtual void CalculateOffsetToAncestorWithLayer(
122 gfx::Point* offset, 128 gfx::Point* offset,
123 ui::Layer** layer_parent) OVERRIDE; 129 ui::Layer** layer_parent) OVERRIDE;
124 130
125 private: 131 private:
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 int last_mouse_event_flags_; 177 int last_mouse_event_flags_;
172 int last_mouse_event_x_; 178 int last_mouse_event_x_;
173 int last_mouse_event_y_; 179 int last_mouse_event_y_;
174 180
175 // The gesture_manager_ for this. 181 // The gesture_manager_ for this.
176 GestureManager* gesture_manager_; 182 GestureManager* gesture_manager_;
177 183
178 // The view currently handling touch events. 184 // The view currently handling touch events.
179 View* touch_pressed_handler_; 185 View* touch_pressed_handler_;
180 186
187 // The view currently handling gesture events.
188 View* gesture_handler_;
rjkroege 2011/11/01 18:42:22 I'd call this "gesture_handling_view_" to align th
Gajen 2011/11/02 12:59:35 Agreed, will incorporate in.
Gajen 2011/11/08 08:11:44 Done.
189
181 // Focus --------------------------------------------------------------------- 190 // Focus ---------------------------------------------------------------------
182 191
183 // The focus search algorithm. 192 // The focus search algorithm.
184 FocusSearch focus_search_; 193 FocusSearch focus_search_;
185 194
186 // Whether this root view belongs to the current active window. 195 // Whether this root view belongs to the current active window.
187 // bool activated_; 196 // bool activated_;
188 197
189 // The parent FocusTraversable, used for focus traversal. 198 // The parent FocusTraversable, used for focus traversal.
190 FocusTraversable* focus_traversable_parent_; 199 FocusTraversable* focus_traversable_parent_;
191 200
192 // The View that contains this RootView. This is used when we have RootView 201 // The View that contains this RootView. This is used when we have RootView
193 // wrapped inside native components, and is used for the focus traversal. 202 // wrapped inside native components, and is used for the focus traversal.
194 View* focus_traversable_parent_view_; 203 View* focus_traversable_parent_view_;
195 204
196 // Drag and drop ------------------------------------------------------------- 205 // Drag and drop -------------------------------------------------------------
197 206
198 // Tracks drag state for a view. 207 // Tracks drag state for a view.
199 View::DragInfo drag_info; 208 View::DragInfo drag_info;
200 209
201 DISALLOW_IMPLICIT_CONSTRUCTORS(RootView); 210 DISALLOW_IMPLICIT_CONSTRUCTORS(RootView);
202 }; 211 };
203 212
204 } // namespace internal 213 } // namespace internal
205 } // namespace views 214 } // namespace views
206 215
207 #endif // VIEWS_WIDGET_ROOT_VIEW_H_ 216 #endif // VIEWS_WIDGET_ROOT_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698