| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "ui/views/test/widget_test.h" | 5 #include "ui/views/test/widget_test.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "ui/aura/client/focus_client.h" | 8 #include "ui/aura/client/focus_client.h" |
| 9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
| 10 #include "ui/aura/window_delegate.h" | 10 #include "ui/aura/window_delegate.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 // If second is cleared without success, exit early with failure. | 44 // If second is cleared without success, exit early with failure. |
| 45 if (!*second) | 45 if (!*second) |
| 46 return false; | 46 return false; |
| 47 } | 47 } |
| 48 return false; | 48 return false; |
| 49 } | 49 } |
| 50 | 50 |
| 51 } // namespace | 51 } // namespace |
| 52 | 52 |
| 53 // static | 53 // static |
| 54 void WidgetTest::SimulateNativeDestroy(Widget* widget) { | |
| 55 delete widget->GetNativeView(); | |
| 56 } | |
| 57 | |
| 58 // static | |
| 59 void WidgetTest::SimulateNativeActivate(Widget* widget) { | 54 void WidgetTest::SimulateNativeActivate(Widget* widget) { |
| 60 gfx::NativeView native_view = widget->GetNativeView(); | 55 gfx::NativeView native_view = widget->GetNativeView(); |
| 61 aura::client::GetFocusClient(native_view)->FocusWindow(native_view); | 56 aura::client::GetFocusClient(native_view)->FocusWindow(native_view); |
| 62 } | 57 } |
| 63 | 58 |
| 64 // static | 59 // static |
| 65 bool WidgetTest::IsNativeWindowVisible(gfx::NativeWindow window) { | 60 bool WidgetTest::IsNativeWindowVisible(gfx::NativeWindow window) { |
| 66 return window->IsVisible(); | 61 return window->IsVisible(); |
| 67 } | 62 } |
| 68 | 63 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 return widget->GetNativeWindow()->GetRootWindow()->GetHost(); | 109 return widget->GetNativeWindow()->GetRootWindow()->GetHost(); |
| 115 } | 110 } |
| 116 | 111 |
| 117 // static | 112 // static |
| 118 bool WidgetTest::IsNativeWindowTransparent(gfx::NativeWindow window) { | 113 bool WidgetTest::IsNativeWindowTransparent(gfx::NativeWindow window) { |
| 119 return window->transparent(); | 114 return window->transparent(); |
| 120 } | 115 } |
| 121 | 116 |
| 122 } // namespace test | 117 } // namespace test |
| 123 } // namespace views | 118 } // namespace views |
| OLD | NEW |