Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(470)

Side by Side Diff: ui/views/widget/native_widget_mac_unittest.mm

Issue 1918723002: Mac fullscreen low power: Plumb through to AcceleratedWidgetMac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@plumb
Patch Set: Fix widget test Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/accelerated_widget_mac/accelerated_widget_mac.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/accelerated_widget_mac/accelerated_widget_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698