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 <stdint.h> | |
9 | |
10 #include <memory> | 8 #include <memory> |
11 | 9 |
12 #include "base/callback.h" | 10 #include "services/ui/display/platform_screen_delegate.h" |
13 | |
14 namespace gfx { | |
15 class Rect; | |
16 } | |
17 | 11 |
18 namespace display { | 12 namespace display { |
19 | 13 |
20 // PlatformScreen provides the necessary functionality to configure all | 14 // PlatformScreen provides the necessary functionality to configure all |
21 // attached physical displays. | 15 // attached physical displays. |
22 class PlatformScreen { | 16 class PlatformScreen { |
23 public: | 17 public: |
24 using ConfiguredDisplayCallback = | |
25 base::Callback<void(int64_t, const gfx::Rect&)>; | |
26 | |
27 virtual ~PlatformScreen() {} | 18 virtual ~PlatformScreen() {} |
28 | 19 |
29 // Creates a PlatformScreen instance. | 20 // Creates a PlatformScreen instance. |
30 static std::unique_ptr<PlatformScreen> Create(); | 21 static std::unique_ptr<PlatformScreen> Create(); |
31 | 22 |
32 // Initializes platform specific screen resources. | 23 // Triggers initial display configuration to start. On device this will |
33 virtual void Init() = 0; | 24 // configuration the connected displays. Off device this will create one or |
34 | 25 // more fake displays and pretend to configure them. A non-null |delegate| |
35 // ConfigurePhysicalDisplay() configures a single physical display and returns | 26 // must be provided that will receive notifications when displays are added, |
36 // its id and bounds for it via |callback|. | 27 // removed or modified. |
37 virtual void ConfigurePhysicalDisplay( | 28 virtual void InitialConfig(PlatformScreenDelegate* delegate) = 0; |
sky
2016/08/25 23:40:31
optional: I think Init() is a better are more well
kylechar
2016/08/26 13:21:19
Done.
| |
38 const ConfiguredDisplayCallback& callback) = 0; | |
39 | 29 |
40 virtual int64_t GetPrimaryDisplayId() const = 0; | 30 virtual int64_t GetPrimaryDisplayId() const = 0; |
41 }; | 31 }; |
42 | 32 |
43 } // namespace display | 33 } // namespace display |
44 | 34 |
45 #endif // SERVICES_UI_DISPLAY_PLATFORM_SCREEN_H_ | 35 #endif // SERVICES_UI_DISPLAY_PLATFORM_SCREEN_H_ |
OLD | NEW |