| OLD | NEW |
| 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/native_theme/native_theme.h" |
| 12 #include "ui/views/focus/focus_manager.h" | 13 #include "ui/views/focus/focus_manager.h" |
| 13 #include "ui/views/focus/focus_search.h" | 14 #include "ui/views/focus/focus_search.h" |
| 14 #include "ui/views/view.h" | 15 #include "ui/views/view.h" |
| 15 | 16 |
| 16 namespace views { | 17 namespace views { |
| 17 | 18 |
| 18 namespace test { | 19 namespace test { |
| 19 class WidgetTest; | 20 class WidgetTest; |
| 20 } | 21 } |
| 21 | 22 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 38 // sized to fill the bounds of the RootView (and hence the client area of the | 39 // sized to fill the bounds of the RootView (and hence the client area of the |
| 39 // Widget). Call SetContentsView() after the associated Widget has been | 40 // Widget). Call SetContentsView() after the associated Widget has been |
| 40 // initialized to attach the contents view to the RootView. | 41 // initialized to attach the contents view to the RootView. |
| 41 // TODO(beng): Enforce no other callers to AddChildView/tree functions by | 42 // TODO(beng): Enforce no other callers to AddChildView/tree functions by |
| 42 // overriding those methods as private here. | 43 // overriding those methods as private here. |
| 43 // TODO(beng): Clean up API further, make Widget a friend. | 44 // TODO(beng): Clean up API further, make Widget a friend. |
| 44 // TODO(sky): We don't really want to export this class. | 45 // TODO(sky): We don't really want to export this class. |
| 45 // | 46 // |
| 46 class VIEWS_EXPORT RootView : public View, | 47 class VIEWS_EXPORT RootView : public View, |
| 47 public FocusTraversable, | 48 public FocusTraversable, |
| 48 public ui::EventProcessor { | 49 public ui::EventProcessor, |
| 50 public ui::NativeThemeObserver { |
| 49 public: | 51 public: |
| 50 static const char kViewClassName[]; | 52 static const char kViewClassName[]; |
| 51 | 53 |
| 52 // Creation and lifetime ----------------------------------------------------- | 54 // Creation and lifetime ----------------------------------------------------- |
| 53 explicit RootView(Widget* widget); | 55 explicit RootView(Widget* widget); |
| 54 virtual ~RootView(); | 56 virtual ~RootView(); |
| 55 | 57 |
| 56 // Tree operations ----------------------------------------------------------- | 58 // Tree operations ----------------------------------------------------------- |
| 57 | 59 |
| 58 // Sets the "contents view" of the RootView. This is the single child view | 60 // Sets the "contents view" of the RootView. This is the single child view |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE; | 104 virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE; |
| 103 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; | 105 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; |
| 104 virtual void OnMouseCaptureLost() OVERRIDE; | 106 virtual void OnMouseCaptureLost() OVERRIDE; |
| 105 virtual void OnMouseMoved(const ui::MouseEvent& event) OVERRIDE; | 107 virtual void OnMouseMoved(const ui::MouseEvent& event) OVERRIDE; |
| 106 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE; | 108 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE; |
| 107 virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) OVERRIDE; | 109 virtual bool OnMouseWheel(const ui::MouseWheelEvent& event) OVERRIDE; |
| 108 virtual void SetMouseHandler(View* new_mouse_handler) OVERRIDE; | 110 virtual void SetMouseHandler(View* new_mouse_handler) OVERRIDE; |
| 109 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; | 111 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; |
| 110 virtual void UpdateParentLayer() OVERRIDE; | 112 virtual void UpdateParentLayer() OVERRIDE; |
| 111 | 113 |
| 114 // Overridden from ui::NativeThemeObserver: |
| 115 virtual void OnNativeThemeChange() OVERRIDE; |
| 116 |
| 112 protected: | 117 protected: |
| 113 virtual void DispatchGestureEvent(ui::GestureEvent* event); | 118 virtual void DispatchGestureEvent(ui::GestureEvent* event); |
| 114 | 119 |
| 115 // Overridden from View: | 120 // Overridden from View: |
| 116 virtual void ViewHierarchyChanged( | 121 virtual void ViewHierarchyChanged( |
| 117 const ViewHierarchyChangedDetails& details) OVERRIDE; | 122 const ViewHierarchyChangedDetails& details) OVERRIDE; |
| 118 virtual void VisibilityChanged(View* starting_from, bool is_visible) OVERRIDE; | 123 virtual void VisibilityChanged(View* starting_from, bool is_visible) OVERRIDE; |
| 119 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 124 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; |
| 120 virtual gfx::Vector2d CalculateOffsetToAncestorWithLayer( | 125 virtual gfx::Vector2d CalculateOffsetToAncestorWithLayer( |
| 121 ui::Layer** layer_parent) OVERRIDE; | 126 ui::Layer** layer_parent) OVERRIDE; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 // Tracks drag state for a view. | 225 // Tracks drag state for a view. |
| 221 View::DragInfo drag_info_; | 226 View::DragInfo drag_info_; |
| 222 | 227 |
| 223 DISALLOW_IMPLICIT_CONSTRUCTORS(RootView); | 228 DISALLOW_IMPLICIT_CONSTRUCTORS(RootView); |
| 224 }; | 229 }; |
| 225 | 230 |
| 226 } // namespace internal | 231 } // namespace internal |
| 227 } // namespace views | 232 } // namespace views |
| 228 | 233 |
| 229 #endif // UI_VIEWS_WIDGET_ROOT_VIEW_H_ | 234 #endif // UI_VIEWS_WIDGET_ROOT_VIEW_H_ |
| OLD | NEW |