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

Side by Side Diff: ui/display/mac/screen_mac.mm

Issue 2207043002: SetDeviceScaleFactorForTest Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: SetDeviceScaleFactorForTest Created 4 years, 4 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/display/display.cc ('k') | ui/display/screen.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/display/screen.h" 5 #include "ui/display/screen.h"
6 6
7 #import <ApplicationServices/ApplicationServices.h> 7 #import <ApplicationServices/ApplicationServices.h>
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 } 182 }
183 183
184 void AddObserver(DisplayObserver* observer) override { 184 void AddObserver(DisplayObserver* observer) override {
185 change_notifier_.AddObserver(observer); 185 change_notifier_.AddObserver(observer);
186 } 186 }
187 187
188 void RemoveObserver(DisplayObserver* observer) override { 188 void RemoveObserver(DisplayObserver* observer) override {
189 change_notifier_.RemoveObserver(observer); 189 change_notifier_.RemoveObserver(observer);
190 } 190 }
191 191
192 void SetDeviceScaleFactorForTest(float scale_factor) override {
193 display::Display::SetForceDeviceScaleFactorForTesting(scale_factor);
194 ConfigureTimerFired();
195 }
196
192 static void DisplayReconfigurationCallBack(CGDirectDisplayID display, 197 static void DisplayReconfigurationCallBack(CGDirectDisplayID display,
193 CGDisplayChangeSummaryFlags flags, 198 CGDisplayChangeSummaryFlags flags,
194 void* userInfo) { 199 void* userInfo) {
195 if (flags & kCGDisplayBeginConfigurationFlag) 200 if (flags & kCGDisplayBeginConfigurationFlag)
196 return; 201 return;
197 202
198 static_cast<ScreenMac*>(userInfo)->HandleDisplayReconfiguration(); 203 static_cast<ScreenMac*>(userInfo)->HandleDisplayReconfiguration();
199 } 204 }
200 205
201 void HandleDisplayReconfiguration() { 206 void HandleDisplayReconfiguration() {
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 285
281 } // namespace 286 } // namespace
282 287
283 #if !defined(USE_AURA) 288 #if !defined(USE_AURA)
284 Screen* CreateNativeScreen() { 289 Screen* CreateNativeScreen() {
285 return new ScreenMac; 290 return new ScreenMac;
286 } 291 }
287 #endif 292 #endif
288 293
289 } // namespace display 294 } // namespace display
OLDNEW
« no previous file with comments | « ui/display/display.cc ('k') | ui/display/screen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698