This source file includes following definitions.
- OnWidgetDestroying
#include "ui/views/test/test_widget_observer.h"
#include "base/logging.h"
#include "ui/views/widget/widget.h"
namespace views {
namespace test {
TestWidgetObserver::TestWidgetObserver(Widget* widget)
: widget_(widget) {
widget_->AddObserver(this);
}
TestWidgetObserver::~TestWidgetObserver() {
if (widget_)
widget_->RemoveObserver(this);
}
void TestWidgetObserver::OnWidgetDestroying(Widget* widget) {
DCHECK_EQ(widget_, widget);
widget_ = NULL;
}
}
}