| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |