Index: ui/views/widget/widget.h |
diff --git a/ui/views/widget/widget.h b/ui/views/widget/widget.h |
index 2d6e6aaff6e37d50f6448f4137f84ffbc6821483..50401b1b889cbf9d110579a4afa6dad2bea53a7a 100644 |
--- a/ui/views/widget/widget.h |
+++ b/ui/views/widget/widget.h |
@@ -19,6 +19,7 @@ |
#include "ui/gfx/rect.h" |
#include "ui/views/focus/focus_manager.h" |
#include "ui/views/widget/native_widget_delegate.h" |
+#include "ui/views/widget/widget_observer.h" |
#include "ui/views/window/client_view.h" |
#include "ui/views/window/non_client_view.h" |
@@ -60,7 +61,6 @@ class NonClientFrameView; |
class ScopedEvent; |
class View; |
class WidgetDelegate; |
-class WidgetObserver; |
namespace internal { |
class NativeWidgetPrivate; |
@@ -851,6 +851,25 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, |
DISALLOW_COPY_AND_ASSIGN(Widget); |
}; |
+// A simple WidgetObserver that can be probed for the life of a widget. |
+class WidgetDeletionObserver : public WidgetObserver { |
sky
2013/04/05 17:23:37
Move this (and implementation) into its own file.
varunjain
2013/04/05 18:01:44
Done.
|
+ public: |
+ explicit WidgetDeletionObserver(Widget* widget); |
+ ~WidgetDeletionObserver(); |
sky
2013/04/05 17:23:37
virtual
varunjain
2013/04/05 18:01:44
Done.
|
+ |
+ // Returns true if the widget passed in the constructor is still alive. |
+ bool IsWidgetAlive(); |
sky
2013/04/05 17:23:37
nit: inline this.
varunjain
2013/04/05 18:01:44
Done.
|
+ |
+ // Overridden from WidgetObserver. |
+ virtual void OnWidgetDestroying(Widget* widget) OVERRIDE; |
+ |
+ private: |
+ void CleanupWidget(); |
+ Widget* widget_; |
sky
2013/04/05 17:23:37
nit: newline between 867/868.
varunjain
2013/04/05 18:01:44
Done.
|
+ |
+ DISALLOW_COPY_AND_ASSIGN(WidgetDeletionObserver); |
+}; |
+ |
} // namespace views |
#endif // UI_VIEWS_WIDGET_WIDGET_H_ |