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

Unified Diff: services/native_viewport/ozone/display_manager.h

Issue 1309273005: native_viewport support for ozone (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 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
Index: services/native_viewport/ozone/display_manager.h
diff --git a/services/native_viewport/ozone/display_manager.h b/services/native_viewport/ozone/display_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..816841fc63ddbed76d6516c1f6e95480448e24f6
--- /dev/null
+++ b/services/native_viewport/ozone/display_manager.h
@@ -0,0 +1,45 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SERVICES_NATIVE_VIEWPORT_DISPLAY_MANAGER_H_
+#define SERVICES_NATIVE_VIEWPORT_DISPLAY_MANAGER_H_
+
+#include <vector>
+#include "ui/display/types/native_display_delegate.h"
+#include "ui/display/types/native_display_observer.h"
+#include "ui/gfx/geometry/rect.h"
+
+namespace native_viewport {
+
+class DisplayManager : public ui::NativeDisplayObserver {
+ public:
+ DisplayManager();
+ ~DisplayManager() override;
+
+ private:
+ void OnDisplaysAquired(const std::vector<ui::DisplaySnapshot*>& displays);
+ void OnDisplayConfigured(const gfx::Rect& bounds, bool success);
+
+ // ui::NativeDisplayObserver
+ void OnConfigurationChanged() override;
+
+ scoped_ptr<ui::NativeDisplayDelegate> delegate_;
+
+ // Flags used to keep track of the current state of display configuration.
+ //
+ // True if configuring the displays. In this case a new display configuration
+ // isn't started.
+ bool is_configuring_ = false;
jamesr 2015/08/25 00:30:28 guideline for member initialization like this is t
cdotstout 2015/08/27 19:10:21 Done.
+
+ // If |is_configuring_| is true and another display configuration event
+ // happens, the event is deferred. This is set to true and a display
+ // configuration will be scheduled after the current one finishes.
+ bool should_configure_ = false;
+
+ DISALLOW_COPY_AND_ASSIGN(DisplayManager);
+};
+
+} // namespace
jamesr 2015/08/25 00:30:28 } // namespace native_viewport
cdotstout 2015/08/27 19:10:21 Done.
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698