| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stdio.h> | 5 #include <stdio.h> |
| 6 | 6 |
| 7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/display/display_layout_store.h" | 8 #include "ash/display/display_layout_store.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 DisplayLayout DisplayLayoutStore::ComputeDisplayLayoutForDisplayIdPair( | 60 DisplayLayout DisplayLayoutStore::ComputeDisplayLayoutForDisplayIdPair( |
| 61 const DisplayIdPair& pair) { | 61 const DisplayIdPair& pair) { |
| 62 DisplayLayout layout = GetRegisteredDisplayLayout(pair); | 62 DisplayLayout layout = GetRegisteredDisplayLayout(pair); |
| 63 DCHECK_NE(layout.primary_id, gfx::Display::kInvalidDisplayID); | 63 DCHECK_NE(layout.primary_id, gfx::Display::kInvalidDisplayID); |
| 64 // Invert if the primary was swapped. If mirrored, first is always | 64 // Invert if the primary was swapped. If mirrored, first is always |
| 65 // primary. | 65 // primary. |
| 66 return (layout.primary_id == gfx::Display::kInvalidDisplayID || | 66 return (layout.primary_id == gfx::Display::kInvalidDisplayID || |
| 67 pair.first == layout.primary_id) ? layout : layout.Invert(); | 67 pair.first == layout.primary_id) ? layout : layout.Invert(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void DisplayLayoutStore::UpdateMirrorStatus(const DisplayIdPair& pair, | 70 void DisplayLayoutStore::UpdateMultiDisplayState(const DisplayIdPair& pair, |
| 71 bool mirrored) { | 71 bool mirrored, |
| 72 bool default_unified) { |
| 72 if (paired_layouts_.find(pair) == paired_layouts_.end()) | 73 if (paired_layouts_.find(pair) == paired_layouts_.end()) |
| 73 CreateDisplayLayout(pair); | 74 CreateDisplayLayout(pair); |
| 74 paired_layouts_[pair].mirrored = mirrored; | 75 paired_layouts_[pair].mirrored = mirrored; |
| 76 paired_layouts_[pair].default_unified = default_unified; |
| 75 } | 77 } |
| 76 | 78 |
| 77 void DisplayLayoutStore::UpdatePrimaryDisplayId(const DisplayIdPair& pair, | 79 void DisplayLayoutStore::UpdatePrimaryDisplayId(const DisplayIdPair& pair, |
| 78 int64 display_id) { | 80 int64 display_id) { |
| 79 if (paired_layouts_.find(pair) == paired_layouts_.end()) | 81 if (paired_layouts_.find(pair) == paired_layouts_.end()) |
| 80 CreateDisplayLayout(pair); | 82 CreateDisplayLayout(pair); |
| 81 paired_layouts_[pair].primary_id = display_id; | 83 paired_layouts_[pair].primary_id = display_id; |
| 82 } | 84 } |
| 83 | 85 |
| 84 DisplayLayout DisplayLayoutStore::CreateDisplayLayout( | 86 DisplayLayout DisplayLayoutStore::CreateDisplayLayout( |
| 85 const DisplayIdPair& pair) { | 87 const DisplayIdPair& pair) { |
| 86 DisplayLayout layout = default_display_layout_; | 88 DisplayLayout layout = default_display_layout_; |
| 87 layout.primary_id = pair.first; | 89 layout.primary_id = pair.first; |
| 88 paired_layouts_[pair] = layout; | 90 paired_layouts_[pair] = layout; |
| 89 return layout; | 91 return layout; |
| 90 } | 92 } |
| 91 | 93 |
| 92 } // namespace ash | 94 } // namespace ash |
| OLD | NEW |