Automated Commit: Committing new LKGM version 7479.0.0 for chromeos.
[chromium-blink-merge.git] / ui / views / test / test_widget_observer.h
blobfc3e8ecd66085a792e374b1dc2c9bb9b9a426f83
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 #ifndef UI_VIEWS_TEST_TEST_WIDGET_OBSERVER_H_
6 #define UI_VIEWS_TEST_TEST_WIDGET_OBSERVER_H_
8 #include <stddef.h>
10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h"
12 #include "ui/views/widget/widget_observer.h"
14 namespace views {
15 namespace test {
17 // A Widget observer class used in the tests below to observe bubbles closing.
18 class TestWidgetObserver : public WidgetObserver {
19 public:
20 explicit TestWidgetObserver(Widget* widget);
21 ~TestWidgetObserver() override;
23 bool widget_closed() const { return widget_ == NULL; }
25 private:
26 // WidgetObserver overrides:
27 void OnWidgetDestroying(Widget* widget) override;
29 Widget* widget_;
31 DISALLOW_COPY_AND_ASSIGN(TestWidgetObserver);
34 } // namespace test
35 } // namespace views
37 #endif // UI_VIEWS_TEST_TEST_WIDGET_OBSERVER_H_