| 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 #import "ui/views/widget/native_widget_mac.h" | 5 #import "ui/views/widget/native_widget_mac.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 8 | 8 |
| 9 #import "base/mac/foundation_util.h" | 9 #import "base/mac/foundation_util.h" |
| 10 #import "base/mac/scoped_nsobject.h" | 10 #import "base/mac/scoped_nsobject.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 namespace views { | 80 namespace views { |
| 81 namespace test { | 81 namespace test { |
| 82 | 82 |
| 83 // BridgedNativeWidget friend to access private members. | 83 // BridgedNativeWidget friend to access private members. |
| 84 class BridgedNativeWidgetTestApi { | 84 class BridgedNativeWidgetTestApi { |
| 85 public: | 85 public: |
| 86 explicit BridgedNativeWidgetTestApi(NSWindow* window) { | 86 explicit BridgedNativeWidgetTestApi(NSWindow* window) { |
| 87 bridge_ = NativeWidgetMac::GetBridgeForNativeWindow(window); | 87 bridge_ = NativeWidgetMac::GetBridgeForNativeWindow(window); |
| 88 } | 88 } |
| 89 | 89 |
| 90 // Simulate a frame swap from the compositor. Assumes scale factor of 1.0f. | 90 // Simulate a frame swap from the compositor. |
| 91 void SimulateFrameSwap(const gfx::Size& size) { | 91 void SimulateFrameSwap(const gfx::Size& size) { |
| 92 const float kScaleFactor = 1.0f; | 92 const float kScaleFactor = 1.0f; |
| 93 bridge_->compositor_widget_->GotFrame( | 93 bridge_->compositor_widget_->GotIOSurfaceFrame( |
| 94 0, false, 0, base::ScopedCFTypeRef<IOSurfaceRef>(), size, kScaleFactor); | 94 base::ScopedCFTypeRef<IOSurfaceRef>(), size, kScaleFactor); |
| 95 bridge_->AcceleratedWidgetSwapCompleted(); | 95 bridge_->AcceleratedWidgetSwapCompleted(); |
| 96 } | 96 } |
| 97 | 97 |
| 98 private: | 98 private: |
| 99 BridgedNativeWidget* bridge_; | 99 BridgedNativeWidget* bridge_; |
| 100 | 100 |
| 101 DISALLOW_COPY_AND_ASSIGN(BridgedNativeWidgetTestApi); | 101 DISALLOW_COPY_AND_ASSIGN(BridgedNativeWidgetTestApi); |
| 102 }; | 102 }; |
| 103 | 103 |
| 104 // Custom native_widget to create a NativeWidgetMacTestWindow. | 104 // Custom native_widget to create a NativeWidgetMacTestWindow. |
| (...skipping 1480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1585 lastDirtyRect_ = dirtyRect; | 1585 lastDirtyRect_ = dirtyRect; |
| 1586 } | 1586 } |
| 1587 | 1587 |
| 1588 @end | 1588 @end |
| 1589 | 1589 |
| 1590 @implementation FocusableTestNSView | 1590 @implementation FocusableTestNSView |
| 1591 - (BOOL)acceptsFirstResponder { | 1591 - (BOOL)acceptsFirstResponder { |
| 1592 return YES; | 1592 return YES; |
| 1593 } | 1593 } |
| 1594 @end | 1594 @end |
| OLD | NEW |