| 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 <Cocoa/Cocoa.h> | 7 #include <Cocoa/Cocoa.h> |
| 8 | 8 |
| 9 #import "base/mac/scoped_nsobject.h" | 9 #import "base/mac/scoped_nsobject.h" |
| 10 #import "base/mac/scoped_objc_class_swizzler.h" | 10 #import "base/mac/scoped_objc_class_swizzler.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 ui::internal::InputMethodDelegate* WidgetTest::GetInputMethodDelegateForWidget( | 78 ui::internal::InputMethodDelegate* WidgetTest::GetInputMethodDelegateForWidget( |
| 79 Widget* widget) { | 79 Widget* widget) { |
| 80 return NativeWidgetMac::GetBridgeForNativeWindow(widget->GetNativeWindow()); | 80 return NativeWidgetMac::GetBridgeForNativeWindow(widget->GetNativeWindow()); |
| 81 } | 81 } |
| 82 | 82 |
| 83 // static | 83 // static |
| 84 bool WidgetTest::IsNativeWindowTransparent(gfx::NativeWindow window) { | 84 bool WidgetTest::IsNativeWindowTransparent(gfx::NativeWindow window) { |
| 85 return ![window isOpaque]; | 85 return ![window isOpaque]; |
| 86 } | 86 } |
| 87 | 87 |
| 88 // static |
| 89 Widget::Widgets WidgetTest::GetAllWidgets() { |
| 90 Widget::Widgets all_widgets; |
| 91 for (NSWindow* window : [NSApp windows]) { |
| 92 if (Widget* widget = Widget::GetWidgetForNativeWindow(window)) |
| 93 all_widgets.insert(widget); |
| 94 } |
| 95 return all_widgets; |
| 96 } |
| 97 |
| 88 } // namespace test | 98 } // namespace test |
| 89 } // namespace views | 99 } // namespace views |
| OLD | NEW |