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_SCREEN_MANAGER_H_ | 5 #ifndef SERVICES_UI_DISPLAY_SCREEN_MANAGER_H_ |
6 #define SERVICES_UI_DISPLAY_SCREEN_MANAGER_H_ | 6 #define SERVICES_UI_DISPLAY_SCREEN_MANAGER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "services/ui/display/screen_manager_delegate.h" | 11 #include "services/ui/display/screen_manager_delegate.h" |
12 | 12 |
13 namespace service_manager { | 13 namespace service_manager { |
14 class BinderRegistry; | 14 class BinderRegistry; |
15 } | 15 } |
16 | 16 |
17 namespace display { | 17 namespace display { |
18 | 18 |
| 19 class ScreenBase; |
| 20 |
19 // ScreenManager provides the necessary functionality to configure all | 21 // ScreenManager provides the necessary functionality to configure all |
20 // attached physical displays. | 22 // attached physical displays. |
21 class ScreenManager { | 23 class ScreenManager { |
22 public: | 24 public: |
23 ScreenManager(); | 25 ScreenManager(); |
24 virtual ~ScreenManager(); | 26 virtual ~ScreenManager(); |
25 | 27 |
26 // Creates a singleton ScreenManager instance. | 28 // Creates a singleton ScreenManager instance. |
27 static std::unique_ptr<ScreenManager> Create(); | 29 static std::unique_ptr<ScreenManager> Create(); |
28 static ScreenManager* GetInstance(); | 30 static ScreenManager* GetInstance(); |
29 | 31 |
30 // Registers Mojo interfaces provided. | 32 // Registers Mojo interfaces provided. |
31 virtual void AddInterfaces(service_manager::BinderRegistry* registry) = 0; | 33 virtual void AddInterfaces(service_manager::BinderRegistry* registry) = 0; |
32 | 34 |
33 // Triggers initial display configuration to start. On device this will | 35 // Triggers initial display configuration to start. On device this will |
34 // configuration the connected displays. Off device this will create one or | 36 // configuration the connected displays. Off device this will create one or |
35 // more fake displays and pretend to configure them. A non-null |delegate| | 37 // more fake displays and pretend to configure them. A non-null |delegate| |
36 // must be provided that will receive notifications when displays are added, | 38 // must be provided that will receive notifications when displays are added, |
37 // removed or modified. | 39 // removed or modified. |
38 virtual void Init(ScreenManagerDelegate* delegate) = 0; | 40 virtual void Init(ScreenManagerDelegate* delegate) = 0; |
39 | 41 |
40 // Handle requests from the platform to close a display. | 42 // Handle requests from the platform to close a display. |
41 virtual void RequestCloseDisplay(int64_t display_id) = 0; | 43 virtual void RequestCloseDisplay(int64_t display_id) = 0; |
42 | 44 |
| 45 virtual display::ScreenBase* GetScreen() = 0; |
| 46 |
43 private: | 47 private: |
44 static ScreenManager* instance_; // Instance is not owned. | 48 static ScreenManager* instance_; // Instance is not owned. |
45 | 49 |
46 DISALLOW_COPY_AND_ASSIGN(ScreenManager); | 50 DISALLOW_COPY_AND_ASSIGN(ScreenManager); |
47 }; | 51 }; |
48 | 52 |
49 } // namespace display | 53 } // namespace display |
50 | 54 |
51 #endif // SERVICES_UI_DISPLAY_SCREEN_MANAGER_H_ | 55 #endif // SERVICES_UI_DISPLAY_SCREEN_MANAGER_H_ |
OLD | NEW |