Chromium Code Reviews| Index: services/ui/display/platform_screen.h |
| diff --git a/services/ui/display/platform_screen.h b/services/ui/display/platform_screen.h |
| index 4c3aa456b3ea03c789bc09061068134fedf4d037..79c0753a63d4bccbc30a68854758792c69f19369 100644 |
| --- a/services/ui/display/platform_screen.h |
| +++ b/services/ui/display/platform_screen.h |
| @@ -9,21 +9,32 @@ |
| #include <memory> |
| -#include "base/callback.h" |
| - |
| namespace gfx { |
| class Rect; |
| } |
| namespace display { |
| +class PlatformScreen; |
| + |
| +// The PlatformScreen delegate will be informed of changes to the physical |
| +// and/or virtual displays that are connected. |
| +class PlatformScreenDelegate { |
|
sky
2016/08/25 19:18:43
It's common chrome practice (and mentioned in styl
kylechar
2016/08/25 20:26:01
Done.
|
| + public: |
| + // Called when a display is added. |
| + virtual void OnDisplayAdded(PlatformScreen* platform_screen, |
| + int64_t id, |
| + const gfx::Rect& bounds) = 0; |
| + // Called when a display is removed. |
| + virtual void OnDisplayRemoved(int64_t id) = 0; |
| + // Called when a display is modified. |
| + virtual void OnDisplayModified(int64_t id, const gfx::Rect& bounds) = 0; |
| +}; |
| + |
| // PlatformScreen provides the necessary functionality to configure all |
| // attached physical displays. |
| class PlatformScreen { |
| public: |
| - using ConfiguredDisplayCallback = |
| - base::Callback<void(int64_t, const gfx::Rect&)>; |
| - |
| virtual ~PlatformScreen() {} |
| // Creates a PlatformScreen instance. |
| @@ -32,10 +43,12 @@ class PlatformScreen { |
| // Initializes platform specific screen resources. |
| virtual void Init() = 0; |
| - // ConfigurePhysicalDisplay() configures a single physical display and returns |
| - // its id and bounds for it via |callback|. |
| - virtual void ConfigurePhysicalDisplay( |
| - const ConfiguredDisplayCallback& callback) = 0; |
| + // Triggers display configuration to start. On device this will trigger the |
| + // initial configuration of connected displays. Off device this will create |
| + // one or more fake displays and pretend to configure them. A non-null |
| + // |delegate| must be provided that will receive notifications when displays |
| + // are added, removed or modified. |
| + virtual void ConfigureDisplays(PlatformScreenDelegate* delegate) = 0; |
|
sky
2016/08/25 19:18:43
Is there a reason we need both Init and Configure?
kylechar
2016/08/25 20:26:01
Yeah, that definitely works. I've merged Init() an
|
| virtual int64_t GetPrimaryDisplayId() const = 0; |
| }; |