OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "ui/display/display.h" | 7 #include "ui/display/display.h" |
8 #include "ui/gfx/geometry/rect.h" | 8 #include "ui/gfx/geometry/rect.h" |
9 | 9 |
10 namespace display { | 10 namespace display { |
11 | 11 |
12 namespace { | 12 namespace { |
13 | 13 |
14 Screen* g_screen; | 14 Screen* g_screen; |
15 | 15 |
16 } // namespace | 16 } // namespace |
17 | 17 |
18 Screen::Screen() {} | 18 Screen::Screen() {} |
19 | 19 |
20 Screen::~Screen() {} | 20 Screen::~Screen() {} |
21 | 21 |
22 // static | 22 // static |
23 Screen* Screen::GetScreen() { | 23 Screen* Screen::GetScreen() { |
24 #if defined(OS_MACOSX) || defined(OS_ANDROID) | 24 #if defined(OS_MACOSX) |
25 // TODO(scottmg): https://crbug.com/558054 | 25 // TODO(scottmg): https://crbug.com/558054 |
26 if (!g_screen) | 26 if (!g_screen) |
27 g_screen = CreateNativeScreen(); | 27 g_screen = CreateNativeScreen(); |
28 #endif | 28 #endif |
29 return g_screen; | 29 return g_screen; |
30 } | 30 } |
31 | 31 |
32 // static | 32 // static |
33 void Screen::SetScreenInstance(Screen* instance) { | 33 void Screen::SetScreenInstance(Screen* instance) { |
34 g_screen = instance; | 34 g_screen = instance; |
(...skipping 16 matching lines...) Expand all Loading... |
51 for (const display::Display& display_in_list : GetAllDisplays()) { | 51 for (const display::Display& display_in_list : GetAllDisplays()) { |
52 if (display_in_list.id() == display_id) { | 52 if (display_in_list.id() == display_id) { |
53 *display = display_in_list; | 53 *display = display_in_list; |
54 return true; | 54 return true; |
55 } | 55 } |
56 } | 56 } |
57 return false; | 57 return false; |
58 } | 58 } |
59 | 59 |
60 } // namespace display | 60 } // namespace display |
OLD | NEW |