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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 // | 91 // |
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 }; | 102 }; |
102 | 103 |
103 typedef std::set<Widget*> Widgets; | 104 typedef std::set<Widget*> Widgets; |
104 | 105 |
105 enum FrameType { | 106 enum FrameType { |
106 FRAME_TYPE_DEFAULT, // Use whatever the default would be. | 107 FRAME_TYPE_DEFAULT, // Use whatever the default would be. |
107 FRAME_TYPE_FORCE_CUSTOM, // Force the custom frame. | 108 FRAME_TYPE_FORCE_CUSTOM, // Force the custom frame. |
108 FRAME_TYPE_FORCE_NATIVE // Force the native frame. | 109 FRAME_TYPE_FORCE_NATIVE // Force the native frame. |
109 }; | 110 }; |
110 | 111 |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 virtual void EnableInactiveRendering() OVERRIDE; | 614 virtual void EnableInactiveRendering() OVERRIDE; |
614 virtual void OnNativeWidgetActivationChanged(bool active) OVERRIDE; | 615 virtual void OnNativeWidgetActivationChanged(bool active) OVERRIDE; |
615 virtual void OnNativeFocus(gfx::NativeView focused_view) OVERRIDE; | 616 virtual void OnNativeFocus(gfx::NativeView focused_view) OVERRIDE; |
616 virtual void OnNativeBlur(gfx::NativeView focused_view) OVERRIDE; | 617 virtual void OnNativeBlur(gfx::NativeView focused_view) OVERRIDE; |
617 virtual void OnNativeWidgetVisibilityChanged(bool visible) OVERRIDE; | 618 virtual void OnNativeWidgetVisibilityChanged(bool visible) OVERRIDE; |
618 virtual void OnNativeWidgetCreated() OVERRIDE; | 619 virtual void OnNativeWidgetCreated() OVERRIDE; |
619 virtual void OnNativeWidgetDestroying() OVERRIDE; | 620 virtual void OnNativeWidgetDestroying() OVERRIDE; |
620 virtual void OnNativeWidgetDestroyed() OVERRIDE; | 621 virtual void OnNativeWidgetDestroyed() OVERRIDE; |
621 virtual gfx::Size GetMinimumSize() OVERRIDE; | 622 virtual gfx::Size GetMinimumSize() OVERRIDE; |
622 virtual gfx::Size GetMaximumSize() OVERRIDE; | 623 virtual gfx::Size GetMaximumSize() OVERRIDE; |
| 624 virtual void OnNativeWidgetMove() OVERRIDE; |
623 virtual void OnNativeWidgetSizeChanged(const gfx::Size& new_size) OVERRIDE; | 625 virtual void OnNativeWidgetSizeChanged(const gfx::Size& new_size) OVERRIDE; |
624 virtual void OnNativeWidgetBeginUserBoundsChange() OVERRIDE; | 626 virtual void OnNativeWidgetBeginUserBoundsChange() OVERRIDE; |
625 virtual void OnNativeWidgetEndUserBoundsChange() OVERRIDE; | 627 virtual void OnNativeWidgetEndUserBoundsChange() OVERRIDE; |
626 virtual bool HasFocusManager() const OVERRIDE; | 628 virtual bool HasFocusManager() const OVERRIDE; |
627 virtual bool OnNativeWidgetPaintAccelerated( | 629 virtual bool OnNativeWidgetPaintAccelerated( |
628 const gfx::Rect& dirty_region) OVERRIDE; | 630 const gfx::Rect& dirty_region) OVERRIDE; |
629 virtual void OnNativeWidgetPaint(gfx::Canvas* canvas) OVERRIDE; | 631 virtual void OnNativeWidgetPaint(gfx::Canvas* canvas) OVERRIDE; |
630 virtual int GetNonClientComponent(const gfx::Point& point) OVERRIDE; | 632 virtual int GetNonClientComponent(const gfx::Point& point) OVERRIDE; |
631 virtual bool OnKeyEvent(const KeyEvent& event) OVERRIDE; | 633 virtual bool OnKeyEvent(const KeyEvent& event) OVERRIDE; |
632 virtual bool OnMouseEvent(const MouseEvent& event) OVERRIDE; | 634 virtual bool OnMouseEvent(const MouseEvent& event) OVERRIDE; |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
772 // duplicate move events even though the mouse hasn't moved. | 774 // duplicate move events even though the mouse hasn't moved. |
773 bool last_mouse_event_was_move_; | 775 bool last_mouse_event_was_move_; |
774 gfx::Point last_mouse_event_position_; | 776 gfx::Point last_mouse_event_position_; |
775 | 777 |
776 DISALLOW_COPY_AND_ASSIGN(Widget); | 778 DISALLOW_COPY_AND_ASSIGN(Widget); |
777 }; | 779 }; |
778 | 780 |
779 } // namespace views | 781 } // namespace views |
780 | 782 |
781 #endif // UI_VIEWS_WIDGET_WIDGET_H_ | 783 #endif // UI_VIEWS_WIDGET_WIDGET_H_ |
OLD | NEW |