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

Unified Diff: ash/display/display_layout_store.h

Issue 18413002: [Cleanup] Factor out layout store code from DisplayController (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 | « ash/display/display_controller_unittest.cc ('k') | ash/display/display_layout_store.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/display_layout_store.h
diff --git a/ash/display/display_layout_store.h b/ash/display/display_layout_store.h
new file mode 100644
index 0000000000000000000000000000000000000000..cb5b109b588d06b2dfcc48d9c64c058739af717d
--- /dev/null
+++ b/ash/display/display_layout_store.h
@@ -0,0 +1,69 @@
+// Copyright (c) 2013 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 ASH_DISPLAY_DISPLAY_LAYOUT_STORE_H_
+#define ASH_DISPLAY_DISPLAY_LAYOUT_STORE_H_
+
+#include <map>
+
+#include "ash/ash_export.h"
+#include "ash/display/display_layout.h"
+
+namespace ash {
+namespace internal {
+
+class ASH_EXPORT DisplayLayoutStore {
+ public:
+ DisplayLayoutStore();
+ ~DisplayLayoutStore();
+
+ const DisplayLayout& default_display_layout() const {
+ return default_display_layout_;
+ }
+ void SetDefaultDisplayLayout(const DisplayLayout& layout);
+
+ // Registeres the display layout info for the specified display(s).
+ void RegisterLayoutForDisplayIdPair(int64 id1,
+ int64 id2,
+ const DisplayLayout& layout);
+
+ // If no layout is registered, it creatas new layout using
+ // |default_display_layout_|.
+ DisplayLayout GetRegisteredDisplayLayout(const DisplayIdPair& pair);
+
+ // Returns the display layout for the display id pair
+ // with display swapping applied. That is, this returns
+ // flipped layout if the displays are swapped.
+ DisplayLayout ComputeDisplayLayoutForDisplayIdPair(
+ const DisplayIdPair& display_pair);
+
+ // Update the mirrored flag in the display layout for
+ // |display_pair|. This creates new display layout if no layout is
+ // registered for |display_pair|.
+ void UpdateMirrorStatus(const DisplayIdPair& display_pair,
+ bool mirrored);
+
+ // Update the |primary_id| in the display layout for
+ // |display_pair|. This creates new display layout if no layout is
+ // registered for |display_pair|.
+ void UpdatePrimaryDisplayId(const DisplayIdPair& display_pair,
+ int64 display_id);
+
+ private:
+ // Creates new layout for display pair from |default_display_layout_|.
+ DisplayLayout CreateDisplayLayout(const DisplayIdPair& display_pair);
+
+ // The default display layout.
+ DisplayLayout default_display_layout_;
+
+ // Display layout per pair of devices.
+ std::map<DisplayIdPair, DisplayLayout> paired_layouts_;
+
+ DISALLOW_COPY_AND_ASSIGN(DisplayLayoutStore);
+};
+
+} // namespace internal
+} // namespace ash
+
+#endif // ASH_DISPLAY_DISPLAY_LAYOUT_STORE_H_
« no previous file with comments | « ash/display/display_controller_unittest.cc ('k') | ash/display/display_layout_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698