| 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_WIDGET_H_ | 5 #ifndef UI_VIEWS_WIDGET_WIDGET_H_ |
| 6 #define UI_VIEWS_WIDGET_WIDGET_H_ | 6 #define UI_VIEWS_WIDGET_WIDGET_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <stack> | 10 #include <stack> |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, | 92 class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, |
| 93 public FocusTraversable { | 93 public FocusTraversable { |
| 94 public: | 94 public: |
| 95 // Observers can listen to various events on the Widgets. | 95 // Observers can listen to various events on the Widgets. |
| 96 class VIEWS_EXPORT Observer { | 96 class VIEWS_EXPORT Observer { |
| 97 public: | 97 public: |
| 98 virtual void OnWidgetClosing(Widget* widget) {} | 98 virtual void OnWidgetClosing(Widget* widget) {} |
| 99 virtual void OnWidgetVisibilityChanged(Widget* widget, bool visible) {} | 99 virtual void OnWidgetVisibilityChanged(Widget* widget, bool visible) {} |
| 100 virtual void OnWidgetActivationChanged(Widget* widget, bool active) {} | 100 virtual void OnWidgetActivationChanged(Widget* widget, bool active) {} |
| 101 virtual void OnWidgetMoved(Widget* widget) {} | 101 virtual void OnWidgetMoved(Widget* widget) {} |
| 102 protected: |
| 103 virtual ~Observer() {} |
| 102 }; | 104 }; |
| 103 | 105 |
| 104 typedef std::set<Widget*> Widgets; | 106 typedef std::set<Widget*> Widgets; |
| 105 | 107 |
| 106 enum FrameType { | 108 enum FrameType { |
| 107 FRAME_TYPE_DEFAULT, // Use whatever the default would be. | 109 FRAME_TYPE_DEFAULT, // Use whatever the default would be. |
| 108 FRAME_TYPE_FORCE_CUSTOM, // Force the custom frame. | 110 FRAME_TYPE_FORCE_CUSTOM, // Force the custom frame. |
| 109 FRAME_TYPE_FORCE_NATIVE // Force the native frame. | 111 FRAME_TYPE_FORCE_NATIVE // Force the native frame. |
| 110 }; | 112 }; |
| 111 | 113 |
| (...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 639 const gfx::Rect& dirty_region) OVERRIDE; | 641 const gfx::Rect& dirty_region) OVERRIDE; |
| 640 virtual void OnNativeWidgetPaint(gfx::Canvas* canvas) OVERRIDE; | 642 virtual void OnNativeWidgetPaint(gfx::Canvas* canvas) OVERRIDE; |
| 641 virtual int GetNonClientComponent(const gfx::Point& point) OVERRIDE; | 643 virtual int GetNonClientComponent(const gfx::Point& point) OVERRIDE; |
| 642 virtual bool OnKeyEvent(const KeyEvent& event) OVERRIDE; | 644 virtual bool OnKeyEvent(const KeyEvent& event) OVERRIDE; |
| 643 virtual bool OnMouseEvent(const MouseEvent& event) OVERRIDE; | 645 virtual bool OnMouseEvent(const MouseEvent& event) OVERRIDE; |
| 644 virtual void OnMouseCaptureLost() OVERRIDE; | 646 virtual void OnMouseCaptureLost() OVERRIDE; |
| 645 virtual ui::TouchStatus OnTouchEvent(const TouchEvent& event) OVERRIDE; | 647 virtual ui::TouchStatus OnTouchEvent(const TouchEvent& event) OVERRIDE; |
| 646 virtual ui::GestureStatus OnGestureEvent(const GestureEvent& event) OVERRIDE; | 648 virtual ui::GestureStatus OnGestureEvent(const GestureEvent& event) OVERRIDE; |
| 647 virtual bool ExecuteCommand(int command_id) OVERRIDE; | 649 virtual bool ExecuteCommand(int command_id) OVERRIDE; |
| 648 virtual InputMethod* GetInputMethodDirect() OVERRIDE; | 650 virtual InputMethod* GetInputMethodDirect() OVERRIDE; |
| 651 virtual bool HasHitTestMask() const OVERRIDE; |
| 652 virtual void GetHitTestMask(gfx::Path* mask) const OVERRIDE; |
| 649 virtual Widget* AsWidget() OVERRIDE; | 653 virtual Widget* AsWidget() OVERRIDE; |
| 650 virtual const Widget* AsWidget() const OVERRIDE; | 654 virtual const Widget* AsWidget() const OVERRIDE; |
| 651 | 655 |
| 652 // Overridden from FocusTraversable: | 656 // Overridden from FocusTraversable: |
| 653 virtual FocusSearch* GetFocusSearch() OVERRIDE; | 657 virtual FocusSearch* GetFocusSearch() OVERRIDE; |
| 654 virtual FocusTraversable* GetFocusTraversableParent() OVERRIDE; | 658 virtual FocusTraversable* GetFocusTraversableParent() OVERRIDE; |
| 655 virtual View* GetFocusTraversableParentView() OVERRIDE; | 659 virtual View* GetFocusTraversableParentView() OVERRIDE; |
| 656 | 660 |
| 657 protected: | 661 protected: |
| 658 // Creates the RootView to be used within this Widget. Subclasses may override | 662 // Creates the RootView to be used within this Widget. Subclasses may override |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 786 // duplicate move events even though the mouse hasn't moved. | 790 // duplicate move events even though the mouse hasn't moved. |
| 787 bool last_mouse_event_was_move_; | 791 bool last_mouse_event_was_move_; |
| 788 gfx::Point last_mouse_event_position_; | 792 gfx::Point last_mouse_event_position_; |
| 789 | 793 |
| 790 DISALLOW_COPY_AND_ASSIGN(Widget); | 794 DISALLOW_COPY_AND_ASSIGN(Widget); |
| 791 }; | 795 }; |
| 792 | 796 |
| 793 } // namespace views | 797 } // namespace views |
| 794 | 798 |
| 795 #endif // UI_VIEWS_WIDGET_WIDGET_H_ | 799 #endif // UI_VIEWS_WIDGET_WIDGET_H_ |
| OLD | NEW |