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. 4 5 #ifndef UI_VIEWS_TEST_TEST_WIDGET_OBSERVER_H_ 6 #define UI_VIEWS_TEST_TEST_WIDGET_OBSERVER_H_ 7 8 #include <stddef.h> 9 10 #include "base/basictypes.h" 11 #include "base/compiler_specific.h" 12 #include "ui/views/widget/widget_observer.h" 13 14 namespace views { 15 namespace test { 16 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 virtual ~TestWidgetObserver(); 22 23 bool widget_closed() const { return widget_ == NULL; } 24 25 private: 26 // WidgetObserver overrides: 27 virtual void OnWidgetDestroying(Widget* widget) OVERRIDE; 28 29 Widget* widget_; 30 31 DISALLOW_COPY_AND_ASSIGN(TestWidgetObserver); 32 }; 33 34 } // namespace test 35 } // namespace views 36 37 #endif // UI_VIEWS_TEST_TEST_WIDGET_OBSERVER_H_ 38