| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 first = nil; | 63 first = nil; |
| 64 } | 64 } |
| 65 return false; | 65 return false; |
| 66 } | 66 } |
| 67 | 67 |
| 68 gfx::Size WidgetTest::GetNativeWidgetMinimumContentSize(Widget* widget) { | 68 gfx::Size WidgetTest::GetNativeWidgetMinimumContentSize(Widget* widget) { |
| 69 return gfx::Size([widget->GetNativeWindow() contentMinSize]); | 69 return gfx::Size([widget->GetNativeWindow() contentMinSize]); |
| 70 } | 70 } |
| 71 | 71 |
| 72 // static | 72 // static |
| 73 ui::EventProcessor* WidgetTest::GetEventProcessor(Widget* widget) { | 73 ui::EventSink* WidgetTest::GetEventSink(Widget* widget) { |
| 74 return static_cast<internal::RootView*>(widget->GetRootView()); | 74 return static_cast<internal::RootView*>(widget->GetRootView()); |
| 75 } | 75 } |
| 76 | 76 |
| 77 // static | 77 // static |
| 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 | 88 // static |
| 89 Widget::Widgets WidgetTest::GetAllWidgets() { | 89 Widget::Widgets WidgetTest::GetAllWidgets() { |
| 90 Widget::Widgets all_widgets; | 90 Widget::Widgets all_widgets; |
| 91 for (NSWindow* window : [NSApp windows]) { | 91 for (NSWindow* window : [NSApp windows]) { |
| 92 if (Widget* widget = Widget::GetWidgetForNativeWindow(window)) | 92 if (Widget* widget = Widget::GetWidgetForNativeWindow(window)) |
| 93 all_widgets.insert(widget); | 93 all_widgets.insert(widget); |
| 94 } | 94 } |
| 95 return all_widgets; | 95 return all_widgets; |
| 96 } | 96 } |
| 97 | 97 |
| 98 } // namespace test | 98 } // namespace test |
| 99 } // namespace views | 99 } // namespace views |
| OLD | NEW |