| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_VIEWS_TEST_WIDGET_TEST_H_ | 5 #ifndef UI_VIEWS_TEST_WIDGET_TEST_H_ |
| 6 #define UI_VIEWS_TEST_WIDGET_TEST_H_ | 6 #define UI_VIEWS_TEST_WIDGET_TEST_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 // processor. | 83 // processor. |
| 84 static ui::EventProcessor* GetEventProcessor(Widget* widget); | 84 static ui::EventProcessor* GetEventProcessor(Widget* widget); |
| 85 | 85 |
| 86 // Get the InputMethodDelegate, for setting on a Mock InputMethod in tests. | 86 // Get the InputMethodDelegate, for setting on a Mock InputMethod in tests. |
| 87 static ui::internal::InputMethodDelegate* GetInputMethodDelegateForWidget( | 87 static ui::internal::InputMethodDelegate* GetInputMethodDelegateForWidget( |
| 88 Widget* widget); | 88 Widget* widget); |
| 89 | 89 |
| 90 // Return true if |window| is transparent according to the native platform. | 90 // Return true if |window| is transparent according to the native platform. |
| 91 static bool IsNativeWindowTransparent(gfx::NativeWindow window); | 91 static bool IsNativeWindowTransparent(gfx::NativeWindow window); |
| 92 | 92 |
| 93 // Returns the set of all Widgets that currently have a NativeWindow. |
| 94 static Widget::Widgets GetAllWidgets(); |
| 95 |
| 93 private: | 96 private: |
| 94 DISALLOW_COPY_AND_ASSIGN(WidgetTest); | 97 DISALLOW_COPY_AND_ASSIGN(WidgetTest); |
| 95 }; | 98 }; |
| 96 | 99 |
| 97 // A helper WidgetDelegate for tests that require hooks into WidgetDelegate | 100 // A helper WidgetDelegate for tests that require hooks into WidgetDelegate |
| 98 // calls, and removes some of the boilerplate for initializing a Widget. Calls | 101 // calls, and removes some of the boilerplate for initializing a Widget. Calls |
| 99 // Widget::CloseNow() when destroyed if it hasn't already been done. | 102 // Widget::CloseNow() when destroyed if it hasn't already been done. |
| 100 class TestDesktopWidgetDelegate : public WidgetDelegate { | 103 class TestDesktopWidgetDelegate : public WidgetDelegate { |
| 101 public: | 104 public: |
| 102 TestDesktopWidgetDelegate(); | 105 TestDesktopWidgetDelegate(); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 bool observed_; | 174 bool observed_; |
| 172 bool active_; | 175 bool active_; |
| 173 | 176 |
| 174 DISALLOW_COPY_AND_ASSIGN(WidgetActivationWaiter); | 177 DISALLOW_COPY_AND_ASSIGN(WidgetActivationWaiter); |
| 175 }; | 178 }; |
| 176 | 179 |
| 177 } // namespace test | 180 } // namespace test |
| 178 } // namespace views | 181 } // namespace views |
| 179 | 182 |
| 180 #endif // UI_VIEWS_TEST_WIDGET_TEST_H_ | 183 #endif // UI_VIEWS_TEST_WIDGET_TEST_H_ |
| OLD | NEW |