Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(682)

Unified Diff: services/ui/display/platform_screen.h

Issue 2274353003: Add PlatformScreenDelegate and start implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes after once over. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | services/ui/display/platform_screen_impl.h » ('j') | services/ui/ws/window_server_delegate.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
};
« no previous file with comments | « no previous file | services/ui/display/platform_screen_impl.h » ('j') | services/ui/ws/window_server_delegate.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698