| 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" |
| 11 #include "ui/gfx/native_widget_types.h" | 11 #include "ui/gfx/native_widget_types.h" |
| 12 #include "ui/views/test/views_test_base.h" | 12 #include "ui/views/test/views_test_base.h" |
| 13 #include "ui/views/widget/widget_delegate.h" | 13 #include "ui/views/widget/widget_delegate.h" |
| 14 #include "ui/views/widget/widget_observer.h" | 14 #include "ui/views/widget/widget_observer.h" |
| 15 | 15 |
| 16 namespace ui { | 16 namespace ui { |
| 17 namespace internal { | 17 namespace internal { |
| 18 class InputMethodDelegate; | 18 class InputMethodDelegate; |
| 19 } | 19 } |
| 20 class EventProcessor; | 20 class EventSink; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace views { | 23 namespace views { |
| 24 | 24 |
| 25 class Widget; | 25 class Widget; |
| 26 | 26 |
| 27 namespace internal { | 27 namespace internal { |
| 28 | 28 |
| 29 class RootView; | 29 class RootView; |
| 30 | 30 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 static bool IsNativeWindowVisible(gfx::NativeWindow window); | 71 static bool IsNativeWindowVisible(gfx::NativeWindow window); |
| 72 | 72 |
| 73 // Return true if |above| is higher than |below| in the native window Z-order. | 73 // Return true if |above| is higher than |below| in the native window Z-order. |
| 74 // Both windows must be visible. | 74 // Both windows must be visible. |
| 75 static bool IsWindowStackedAbove(Widget* above, Widget* below); | 75 static bool IsWindowStackedAbove(Widget* above, Widget* below); |
| 76 | 76 |
| 77 // Query the native window system for the minimum size configured for user | 77 // Query the native window system for the minimum size configured for user |
| 78 // initiated window resizes. | 78 // initiated window resizes. |
| 79 gfx::Size GetNativeWidgetMinimumContentSize(Widget* widget); | 79 gfx::Size GetNativeWidgetMinimumContentSize(Widget* widget); |
| 80 | 80 |
| 81 // Return the event processor for |widget|. On aura platforms, this is an | 81 // Return the event sink for |widget|. On aura platforms, this is an |
| 82 // aura::WindowEventDispatcher. Otherwise, it is a bridge to the OS event | 82 // aura::WindowEventDispatcher. Otherwise, it is a bridge to the OS event |
| 83 // processor. | 83 // sink. |
| 84 static ui::EventProcessor* GetEventProcessor(Widget* widget); | 84 static ui::EventSink* GetEventSink(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. | 93 // Returns the set of all Widgets that currently have a NativeWindow. |
| 94 static Widget::Widgets GetAllWidgets(); | 94 static Widget::Widgets GetAllWidgets(); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 bool observed_; | 174 bool observed_; |
| 175 bool active_; | 175 bool active_; |
| 176 | 176 |
| 177 DISALLOW_COPY_AND_ASSIGN(WidgetActivationWaiter); | 177 DISALLOW_COPY_AND_ASSIGN(WidgetActivationWaiter); |
| 178 }; | 178 }; |
| 179 | 179 |
| 180 } // namespace test | 180 } // namespace test |
| 181 } // namespace views | 181 } // namespace views |
| 182 | 182 |
| 183 #endif // UI_VIEWS_TEST_WIDGET_TEST_H_ | 183 #endif // UI_VIEWS_TEST_WIDGET_TEST_H_ |
| OLD | NEW |