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

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

Issue 2310133002: Add mojom::DisplayController. (Closed)
Patch Set: Remove acclerator. Created 4 years, 3 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
Index: services/ui/display/platform_screen.h
diff --git a/services/ui/display/platform_screen.h b/services/ui/display/platform_screen.h
index b782ee7ce2a7de9d1cbf92cd4391f6b79bddd3fd..843944200f82362d5ef0c51e42b29cd661694590 100644
--- a/services/ui/display/platform_screen.h
+++ b/services/ui/display/platform_screen.h
@@ -7,6 +7,7 @@
#include <memory>
+#include "base/macros.h"
#include "services/ui/display/platform_screen_delegate.h"
namespace display {
@@ -15,10 +16,12 @@ namespace display {
// attached physical displays.
class PlatformScreen {
public:
- virtual ~PlatformScreen() {}
+ PlatformScreen();
+ virtual ~PlatformScreen();
- // Creates a PlatformScreen instance.
+ // 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.
static std::unique_ptr<PlatformScreen> Create();
+ static PlatformScreen* GetInstance();
// Triggers initial display configuration to start. On device this will
// configuration the connected displays. Off device this will create one or
@@ -28,6 +31,11 @@ class PlatformScreen {
virtual void Init(PlatformScreenDelegate* delegate) = 0;
virtual int64_t GetPrimaryDisplayId() const = 0;
+
+ private:
+ static PlatformScreen* instance_; // Instance is not owned.
+
+ DISALLOW_COPY_AND_ASSIGN(PlatformScreen);
};
} // namespace display

Powered by Google App Engine
This is Rietveld 408576698