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_OBSERVER_H_ | 5 #ifndef UI_VIEWS_WIDGET_WIDGET_OBSERVER_H_ |
6 #define UI_VIEWS_WIDGET_WIDGET_OBSERVER_H_ | 6 #define UI_VIEWS_WIDGET_WIDGET_OBSERVER_H_ |
7 | 7 |
8 #include "ui/views/views_export.h" | 8 #include "ui/views/views_export.h" |
9 | 9 |
10 namespace gfx { | 10 namespace gfx { |
11 class Rect; | 11 class Rect; |
12 } | 12 } |
13 | 13 |
14 namespace views { | 14 namespace views { |
15 | 15 |
16 class Widget; | 16 class Widget; |
17 class View; | |
18 | 17 |
19 // Observers can listen to various events on the Widgets. | 18 // Observers can listen to various events on the Widgets. |
20 class VIEWS_EXPORT WidgetObserver { | 19 class VIEWS_EXPORT WidgetObserver { |
21 public: | 20 public: |
22 // The closing notification is sent immediately in response to (i.e. in the | 21 // The closing notification is sent immediately in response to (i.e. in the |
23 // same call stack as) a request to close the Widget (via Close() or | 22 // same call stack as) a request to close the Widget (via Close() or |
24 // CloseNow()). | 23 // CloseNow()). |
25 virtual void OnWidgetClosing(Widget* widget) {} | 24 virtual void OnWidgetClosing(Widget* widget) {} |
26 | 25 |
27 // Invoked after notification is received from the event loop that the native | 26 // Invoked after notification is received from the event loop that the native |
(...skipping 11 matching lines...) Expand all Loading... |
39 | 38 |
40 virtual void OnWidgetVisibilityChanging(Widget* widget, bool visible) {} | 39 virtual void OnWidgetVisibilityChanging(Widget* widget, bool visible) {} |
41 | 40 |
42 virtual void OnWidgetVisibilityChanged(Widget* widget, bool visible) {} | 41 virtual void OnWidgetVisibilityChanged(Widget* widget, bool visible) {} |
43 | 42 |
44 virtual void OnWidgetActivationChanged(Widget* widget, bool active) {} | 43 virtual void OnWidgetActivationChanged(Widget* widget, bool active) {} |
45 | 44 |
46 virtual void OnWidgetBoundsChanged(Widget* widget, | 45 virtual void OnWidgetBoundsChanged(Widget* widget, |
47 const gfx::Rect& new_bounds) {} | 46 const gfx::Rect& new_bounds) {} |
48 | 47 |
49 // Called after a descendant view of |widget| is removed. | |
50 virtual void OnViewRemoved(Widget* widget, View* view) {} | |
51 | |
52 protected: | 48 protected: |
53 virtual ~WidgetObserver() {} | 49 virtual ~WidgetObserver() {} |
54 }; | 50 }; |
55 | 51 |
56 } // namespace views | 52 } // namespace views |
57 | 53 |
58 #endif // UI_VIEWS_WIDGET_WIDGET_OBSERVER_H_ | 54 #endif // UI_VIEWS_WIDGET_WIDGET_OBSERVER_H_ |
OLD | NEW |