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/gfx/screen.h" | 5 #include "ui/gfx/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 |
11 #include <map> | 11 #include <map> |
| 12 #include <memory> |
12 | 13 |
13 #include "base/logging.h" | 14 #include "base/logging.h" |
14 #include "base/mac/sdk_forward_declarations.h" | 15 #include "base/mac/sdk_forward_declarations.h" |
15 #include "base/macros.h" | 16 #include "base/macros.h" |
16 #include "base/memory/scoped_ptr.h" | |
17 #include "base/timer/timer.h" | 17 #include "base/timer/timer.h" |
18 #include "ui/gfx/display.h" | 18 #include "ui/gfx/display.h" |
19 #include "ui/gfx/display_change_notifier.h" | 19 #include "ui/gfx/display_change_notifier.h" |
20 #include "ui/gfx/mac/coordinate_conversion.h" | 20 #include "ui/gfx/mac/coordinate_conversion.h" |
21 | 21 |
22 namespace { | 22 namespace { |
23 | 23 |
24 // The delay to handle the display configuration changes. | 24 // The delay to handle the display configuration changes. |
25 // See comments in ScreenMac::HandleDisplayReconfiguration. | 25 // See comments in ScreenMac::HandleDisplayReconfiguration. |
26 const int64_t kConfigureDelayMs = 500; | 26 const int64_t kConfigureDelayMs = 500; |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 return std::vector<gfx::Display>(1, GetPrimaryDisplay()); | 242 return std::vector<gfx::Display>(1, GetPrimaryDisplay()); |
243 | 243 |
244 return displays; | 244 return displays; |
245 } | 245 } |
246 | 246 |
247 // The displays currently attached to the device. | 247 // The displays currently attached to the device. |
248 std::vector<gfx::Display> displays_; | 248 std::vector<gfx::Display> displays_; |
249 | 249 |
250 // The timer to delay configuring outputs. See also the comments in | 250 // The timer to delay configuring outputs. See also the comments in |
251 // HandleDisplayReconfiguration(). | 251 // HandleDisplayReconfiguration(). |
252 scoped_ptr<base::OneShotTimer> configure_timer_; | 252 std::unique_ptr<base::OneShotTimer> configure_timer_; |
253 | 253 |
254 gfx::DisplayChangeNotifier change_notifier_; | 254 gfx::DisplayChangeNotifier change_notifier_; |
255 | 255 |
256 DISALLOW_COPY_AND_ASSIGN(ScreenMac); | 256 DISALLOW_COPY_AND_ASSIGN(ScreenMac); |
257 }; | 257 }; |
258 | 258 |
259 } // namespace | 259 } // namespace |
260 | 260 |
261 namespace gfx { | 261 namespace gfx { |
262 | 262 |
263 #if !defined(USE_AURA) | 263 #if !defined(USE_AURA) |
264 Screen* CreateNativeScreen() { | 264 Screen* CreateNativeScreen() { |
265 return new ScreenMac; | 265 return new ScreenMac; |
266 } | 266 } |
267 #endif | 267 #endif |
268 | 268 |
269 } | 269 } |
OLD | NEW |