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

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: rebased 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..d25b840cd104dc74597851ce320a8d15a59b41e8
--- /dev/null
+++ b/services/native_viewport/ozone/display_manager.h
@@ -0,0 +1,48 @@
+// 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 "base/memory/weak_ptr.h"
+#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 OnDisplaysAcquired(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_;
+
+ // 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_;
+
+ base::WeakPtrFactory<DisplayManager> weak_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(DisplayManager);
+};
+
+} // namespace native_viewport
+
+#endif
« no previous file with comments | « services/native_viewport/ozone/app_delegate_ozone.cc ('k') | services/native_viewport/ozone/display_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698