| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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_handling_view_; |
| 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_ |
| OLD | NEW |