Automated Commit: Committing new LKGM version 7479.0.0 for chromeos.
[chromium-blink-merge.git] / ui / views / test / test_widget_observer.cc
blob160f25b2c6a75efc311858449fdf730c6f2a5783
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
3 // found in the LICENSE file.
5 #include "ui/views/test/test_widget_observer.h"
7 #include "base/logging.h"
8 #include "ui/views/widget/widget.h"
10 namespace views {
11 namespace test {
13 TestWidgetObserver::TestWidgetObserver(Widget* widget)
14 : widget_(widget) {
15 widget_->AddObserver(this);
18 TestWidgetObserver::~TestWidgetObserver() {
19 if (widget_)
20 widget_->RemoveObserver(this);
23 void TestWidgetObserver::OnWidgetDestroying(Widget* widget) {
24 DCHECK_EQ(widget_, widget);
25 widget_ = NULL;
28 } // namespace test
29 } // namespace views