OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef SERVICES_UI_DISPLAY_PLATFORM_SCREEN_H_ | 5 #ifndef SERVICES_UI_DISPLAY_PLATFORM_SCREEN_H_ |
6 #define SERVICES_UI_DISPLAY_PLATFORM_SCREEN_H_ | 6 #define SERVICES_UI_DISPLAY_PLATFORM_SCREEN_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | |
10 #include "services/ui/display/platform_screen_delegate.h" | 11 #include "services/ui/display/platform_screen_delegate.h" |
11 | 12 |
12 namespace display { | 13 namespace display { |
13 | 14 |
14 // PlatformScreen provides the necessary functionality to configure all | 15 // PlatformScreen provides the necessary functionality to configure all |
15 // attached physical displays. | 16 // attached physical displays. |
16 class PlatformScreen { | 17 class PlatformScreen { |
17 public: | 18 public: |
18 virtual ~PlatformScreen() {} | 19 PlatformScreen(); |
20 virtual ~PlatformScreen(); | |
19 | 21 |
20 // Creates a PlatformScreen instance. | 22 // Creates a singleton PlatformScreen instance that is owned by caller. |
sky
2016/09/08 18:03:35
'caller' -> 'the caller'.
optional: that this ret
kylechar
2016/09/08 18:12:03
Done.
| |
21 static std::unique_ptr<PlatformScreen> Create(); | 23 static std::unique_ptr<PlatformScreen> Create(); |
24 static PlatformScreen* GetInstance(); | |
22 | 25 |
23 // Triggers initial display configuration to start. On device this will | 26 // Triggers initial display configuration to start. On device this will |
24 // configuration the connected displays. Off device this will create one or | 27 // configuration the connected displays. Off device this will create one or |
25 // more fake displays and pretend to configure them. A non-null |delegate| | 28 // more fake displays and pretend to configure them. A non-null |delegate| |
26 // must be provided that will receive notifications when displays are added, | 29 // must be provided that will receive notifications when displays are added, |
27 // removed or modified. | 30 // removed or modified. |
28 virtual void Init(PlatformScreenDelegate* delegate) = 0; | 31 virtual void Init(PlatformScreenDelegate* delegate) = 0; |
29 | 32 |
30 virtual int64_t GetPrimaryDisplayId() const = 0; | 33 virtual int64_t GetPrimaryDisplayId() const = 0; |
34 | |
35 private: | |
36 static PlatformScreen* instance_; // Instance is not owned. | |
37 | |
38 DISALLOW_COPY_AND_ASSIGN(PlatformScreen); | |
31 }; | 39 }; |
32 | 40 |
33 } // namespace display | 41 } // namespace display |
34 | 42 |
35 #endif // SERVICES_UI_DISPLAY_PLATFORM_SCREEN_H_ | 43 #endif // SERVICES_UI_DISPLAY_PLATFORM_SCREEN_H_ |
OLD | NEW |