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 | |
95 private: | 92 private: |
96 DISALLOW_COPY_AND_ASSIGN(WidgetTest); | 93 DISALLOW_COPY_AND_ASSIGN(WidgetTest); |
97 }; | 94 }; |
98 | 95 |
99 // A helper WidgetDelegate for tests that require hooks into WidgetDelegate | 96 // A helper WidgetDelegate for tests that require hooks into WidgetDelegate |
100 // calls, and removes some of the boilerplate for initializing a Widget. Calls | 97 // calls, and removes some of the boilerplate for initializing a Widget. Calls |
101 // Widget::CloseNow() when destroyed if it hasn't already been done. | 98 // Widget::CloseNow() when destroyed if it hasn't already been done. |
102 class TestDesktopWidgetDelegate : public WidgetDelegate { | 99 class TestDesktopWidgetDelegate : public WidgetDelegate { |
103 public: | 100 public: |
104 TestDesktopWidgetDelegate(); | 101 TestDesktopWidgetDelegate(); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 private: | 147 private: |
151 View* view_; | 148 View* view_; |
152 | 149 |
153 DISALLOW_COPY_AND_ASSIGN(TestInitialFocusWidgetDelegate); | 150 DISALLOW_COPY_AND_ASSIGN(TestInitialFocusWidgetDelegate); |
154 }; | 151 }; |
155 | 152 |
156 } // namespace test | 153 } // namespace test |
157 } // namespace views | 154 } // namespace views |
158 | 155 |
159 #endif // UI_VIEWS_TEST_WIDGET_TEST_H_ | 156 #endif // UI_VIEWS_TEST_WIDGET_TEST_H_ |
OLD | NEW |