| 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 "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 82 |
| 83 // Return the event processor for |widget|. On aura platforms, this is an | 83 // Return the event processor for |widget|. On aura platforms, this is an |
| 84 // aura::WindowEventDispatcher. Otherwise, it is a bridge to the OS event | 84 // aura::WindowEventDispatcher. Otherwise, it is a bridge to the OS event |
| 85 // processor. | 85 // processor. |
| 86 static ui::EventProcessor* GetEventProcessor(Widget* widget); | 86 static ui::EventProcessor* GetEventProcessor(Widget* widget); |
| 87 | 87 |
| 88 // Get the InputMethodDelegate, for setting on a Mock InputMethod in tests. | 88 // Get the InputMethodDelegate, for setting on a Mock InputMethod in tests. |
| 89 static ui::internal::InputMethodDelegate* GetInputMethodDelegateForWidget( | 89 static ui::internal::InputMethodDelegate* GetInputMethodDelegateForWidget( |
| 90 Widget* widget); | 90 Widget* widget); |
| 91 | 91 |
| 92 // Return true if |window| is transparent according to the native platform. |
| 93 static bool IsNativeWindowTransparent(gfx::NativeWindow window); |
| 94 |
| 92 private: | 95 private: |
| 93 DISALLOW_COPY_AND_ASSIGN(WidgetTest); | 96 DISALLOW_COPY_AND_ASSIGN(WidgetTest); |
| 94 }; | 97 }; |
| 95 | 98 |
| 96 // A helper WidgetDelegate for tests that require hooks into WidgetDelegate | 99 // A helper WidgetDelegate for tests that require hooks into WidgetDelegate |
| 97 // calls, and removes some of the boilerplate for initializing a Widget. Calls | 100 // calls, and removes some of the boilerplate for initializing a Widget. Calls |
| 98 // Widget::CloseNow() when destroyed if it hasn't already been done. | 101 // Widget::CloseNow() when destroyed if it hasn't already been done. |
| 99 class TestDesktopWidgetDelegate : public WidgetDelegate { | 102 class TestDesktopWidgetDelegate : public WidgetDelegate { |
| 100 public: | 103 public: |
| 101 TestDesktopWidgetDelegate(); | 104 TestDesktopWidgetDelegate(); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 private: | 150 private: |
| 148 View* view_; | 151 View* view_; |
| 149 | 152 |
| 150 DISALLOW_COPY_AND_ASSIGN(TestInitialFocusWidgetDelegate); | 153 DISALLOW_COPY_AND_ASSIGN(TestInitialFocusWidgetDelegate); |
| 151 }; | 154 }; |
| 152 | 155 |
| 153 } // namespace test | 156 } // namespace test |
| 154 } // namespace views | 157 } // namespace views |
| 155 | 158 |
| 156 #endif // UI_VIEWS_TEST_WIDGET_TEST_H_ | 159 #endif // UI_VIEWS_TEST_WIDGET_TEST_H_ |
| OLD | NEW |