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

Side by Side Diff: ash/display/display_layout_store.cc

Issue 1261693004: Allow dynamic enabling/disabling of unified desktop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.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 unified diff | Download patch
« no previous file with comments | « ash/display/display_layout.cc ('k') | ash/display/display_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ash/display/display_manager.h" 9 #include "ash/display/display_manager.h"
10 #include "ash/display/display_util.h" 10 #include "ash/display/display_util.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 if (!command_line->HasSwitch(switches::kAshSecondaryDisplayLayout)) 44 if (!command_line->HasSwitch(switches::kAshSecondaryDisplayLayout))
45 default_display_layout_ = layout; 45 default_display_layout_ = layout;
46 } 46 }
47 47
48 void DisplayLayoutStore::RegisterLayoutForDisplayIdPair( 48 void DisplayLayoutStore::RegisterLayoutForDisplayIdPair(
49 int64 id1, 49 int64 id1,
50 int64 id2, 50 int64 id2,
51 const DisplayLayout& layout) { 51 const DisplayLayout& layout) {
52 auto key = CreateDisplayIdPair(id1, id2); 52 auto key = CreateDisplayIdPair(id1, id2);
53 paired_layouts_[key] = layout; 53 paired_layouts_[key] = layout;
54 #if defined(OS_CHROMEOS)
55 // Force disabling unified desktop if the flag is not set.
56 if (!switches::UnifiedDesktopEnabled())
57 paired_layouts_[key].default_unified = false;
58 #endif
59 } 54 }
60 55
61 DisplayLayout DisplayLayoutStore::GetRegisteredDisplayLayout( 56 DisplayLayout DisplayLayoutStore::GetRegisteredDisplayLayout(
62 const DisplayIdPair& pair) { 57 const DisplayIdPair& pair) {
63 std::map<DisplayIdPair, DisplayLayout>::const_iterator iter = 58 std::map<DisplayIdPair, DisplayLayout>::const_iterator iter =
64 paired_layouts_.find(pair); 59 paired_layouts_.find(pair);
65 return 60 return
66 iter != paired_layouts_.end() ? iter->second : CreateDisplayLayout(pair); 61 iter != paired_layouts_.end() ? iter->second : CreateDisplayLayout(pair);
67 } 62 }
68 63
(...skipping 25 matching lines...) Expand all
94 89
95 DisplayLayout DisplayLayoutStore::CreateDisplayLayout( 90 DisplayLayout DisplayLayoutStore::CreateDisplayLayout(
96 const DisplayIdPair& pair) { 91 const DisplayIdPair& pair) {
97 DisplayLayout layout = default_display_layout_; 92 DisplayLayout layout = default_display_layout_;
98 layout.primary_id = pair.first; 93 layout.primary_id = pair.first;
99 paired_layouts_[pair] = layout; 94 paired_layouts_[pair] = layout;
100 return layout; 95 return layout;
101 } 96 }
102 97
103 } // namespace ash 98 } // namespace ash
OLDNEW
« no previous file with comments | « ash/display/display_layout.cc ('k') | ash/display/display_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698