| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 class BridgedNativeWidgetTestApi { | 82 class BridgedNativeWidgetTestApi { |
| 83 public: | 83 public: |
| 84 explicit BridgedNativeWidgetTestApi(NSWindow* window) { | 84 explicit BridgedNativeWidgetTestApi(NSWindow* window) { |
| 85 bridge_ = NativeWidgetMac::GetBridgeForNativeWindow(window); | 85 bridge_ = NativeWidgetMac::GetBridgeForNativeWindow(window); |
| 86 } | 86 } |
| 87 | 87 |
| 88 // Simulate a frame swap from the compositor. Assumes scale factor of 1.0f. | 88 // Simulate a frame swap from the compositor. Assumes scale factor of 1.0f. |
| 89 void SimulateFrameSwap(const gfx::Size& size) { | 89 void SimulateFrameSwap(const gfx::Size& size) { |
| 90 const float kScaleFactor = 1.0f; | 90 const float kScaleFactor = 1.0f; |
| 91 bridge_->compositor_widget_->GotFrame( | 91 bridge_->compositor_widget_->GotFrame( |
| 92 0, base::ScopedCFTypeRef<IOSurfaceRef>(), size, kScaleFactor); | 92 0, false, 0, base::ScopedCFTypeRef<IOSurfaceRef>(), size, kScaleFactor); |
| 93 bridge_->AcceleratedWidgetSwapCompleted(); | 93 bridge_->AcceleratedWidgetSwapCompleted(); |
| 94 } | 94 } |
| 95 | 95 |
| 96 private: | 96 private: |
| 97 BridgedNativeWidget* bridge_; | 97 BridgedNativeWidget* bridge_; |
| 98 | 98 |
| 99 DISALLOW_COPY_AND_ASSIGN(BridgedNativeWidgetTestApi); | 99 DISALLOW_COPY_AND_ASSIGN(BridgedNativeWidgetTestApi); |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 // Custom native_widget to create a NativeWidgetMacTestWindow. | 102 // Custom native_widget to create a NativeWidgetMacTestWindow. |
| (...skipping 1407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1510 lastDirtyRect_ = dirtyRect; | 1510 lastDirtyRect_ = dirtyRect; |
| 1511 } | 1511 } |
| 1512 | 1512 |
| 1513 @end | 1513 @end |
| 1514 | 1514 |
| 1515 @implementation FocusableTestNSView | 1515 @implementation FocusableTestNSView |
| 1516 - (BOOL)acceptsFirstResponder { | 1516 - (BOOL)acceptsFirstResponder { |
| 1517 return YES; | 1517 return YES; |
| 1518 } | 1518 } |
| 1519 @end | 1519 @end |
| OLD | NEW |