OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef UI_VIEWS_WIDGET_ROOT_VIEW_H_ |
| 6 #define UI_VIEWS_WIDGET_ROOT_VIEW_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "ui/views/view.h" |
| 10 |
| 11 namespace ui { |
| 12 namespace internal { |
| 13 |
| 14 //////////////////////////////////////////////////////////////////////////////// |
| 15 // RootView class |
| 16 // |
| 17 // A View subclass that owns a View hierarchy. Used by the Widget to perform |
| 18 // View-specific event tracking. |
| 19 // |
| 20 class RootView : public View { |
| 21 public: |
| 22 RootView(Widget* widget, View* contents_view); |
| 23 virtual ~RootView(); |
| 24 |
| 25 // Overridden from View: |
| 26 virtual void OnViewRemoved(View* parent, View* child); |
| 27 virtual bool OnKeyPressed(const KeyEvent& event); |
| 28 virtual bool OnKeyReleased(const KeyEvent& event); |
| 29 virtual bool OnMouseWheel(const MouseWheelEvent& event); |
| 30 virtual bool OnMousePressed(const MouseEvent& event); |
| 31 virtual bool OnMouseDragged(const MouseEvent& event); |
| 32 virtual void OnMouseReleased(const MouseEvent& event); |
| 33 virtual void OnMouseCaptureLost(); |
| 34 virtual void OnMouseMoved(const MouseEvent& event); |
| 35 virtual void OnMouseExited(const MouseEvent& event); |
| 36 virtual void Paint(gfx::Canvas* canvas); |
| 37 virtual void InvalidateRect(const gfx::Rect& invalid_rect); |
| 38 virtual Widget* GetWidget() const; |
| 39 |
| 40 private: |
| 41 Widget* widget_; |
| 42 |
| 43 // The View that the mouse was pressed down on. Used to track drag operations |
| 44 // and to target mouse-released events at the correct view. |
| 45 View* mouse_pressed_handler_; |
| 46 |
| 47 // The View that the mouse is currently over. Used to track mouse-exited |
| 48 // events as the mouse moves from view to view, and when the mouse leaves the |
| 49 // bounds of the containing Widget. |
| 50 View* mouse_move_handler_; |
| 51 |
| 52 // State captured on mouse press that would be useful for a potential drag |
| 53 // operation. |
| 54 DragInfo drag_info_; |
| 55 |
| 56 DISALLOW_COPY_AND_ASSIGN(RootView); |
| 57 }; |
| 58 |
| 59 } // namespace internal |
| 60 } // namespace ui |
| 61 |
| 62 #endif // UI_VIEWS_WIDGET_ROOT_VIEW_H_ |
OLD | NEW |