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

Unified Diff: components/mus/ws/platform_display.h

Issue 1899923002: Basic display management for mus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | components/mus/ws/platform_display.cc » ('j') | components/mus/ws/platform_display.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/platform_display.h
diff --git a/components/mus/ws/platform_display.h b/components/mus/ws/platform_display.h
index e293dbc38e4409b4fd4d69b03ba87ef4552d750c..f41dfc4031337d1ef8f872299a277c10d54c261f 100644
--- a/components/mus/ws/platform_display.h
+++ b/components/mus/ws/platform_display.h
@@ -21,6 +21,9 @@
#include "components/mus/ws/platform_display_delegate.h"
#include "components/mus/ws/platform_display_init_params.h"
#include "mojo/public/cpp/bindings/callback.h"
+#include "ui/display/types/display_snapshot.h"
+#include "ui/display/types/native_display_delegate.h"
+#include "ui/display/types/native_display_observer.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/platform_window/platform_window_delegate.h"
@@ -107,7 +110,8 @@ class PlatformDisplay {
// PlatformDisplay implementation that connects to the services necessary to
// actually display.
class DefaultPlatformDisplay : public PlatformDisplay,
- public ui::PlatformWindowDelegate {
+ public ui::PlatformWindowDelegate,
+ public ui::NativeDisplayObserver {
public:
explicit DefaultPlatformDisplay(const PlatformDisplayInitParams& init_params);
~DefaultPlatformDisplay() override;
@@ -129,6 +133,13 @@ class DefaultPlatformDisplay : public PlatformDisplay,
void RequestCopyOfOutput(
scoped_ptr<cc::CopyOutputRequest> output_request) override;
+ // ui::NativeDisplayObserver:
+ void OnConfigurationChanged() override;
+
+ // Additional display management callbacks.
sky 2016/04/18 21:25:00 Make these private?
rjkroege 2016/04/21 20:19:53 Done.
+ void OnDisplaysAquired(const std::vector<ui::DisplaySnapshot*>& displays);
+ void OnDisplayConfigured(const gfx::Rect& bounds, bool success);
+
private:
void WantToDraw();
@@ -170,6 +181,16 @@ class DefaultPlatformDisplay : public PlatformDisplay,
scoped_ptr<TopLevelDisplayClient> top_level_display_client_;
scoped_ptr<ui::PlatformWindow> platform_window_;
+ // Flags used to keep track of the current state of display configuration.
+ // |is_configuring| is true if configuring the displays and starts false.
+ bool is_configuring_;
+ // If |is_configuring_| is true and another display configuration event
+ // happens, the event is deferred. |should_configure_| is set to true and a
+ // display configuration will be scheduled after the current one finishes.
+ // NB: events are handled once per vblank.
+ bool should_configure_;
+ scoped_ptr<ui::NativeDisplayDelegate> native_display_delegate_;
+
#if !defined(OS_ANDROID)
scoped_ptr<ui::CursorLoader> cursor_loader_;
#endif
« no previous file with comments | « no previous file | components/mus/ws/platform_display.cc » ('j') | components/mus/ws/platform_display.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698