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

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

Issue 1638413007: Use list instead of pair to represent the set of displays. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix build error Created 4 years, 10 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 | « no previous file | ash/display/display_layout.h » ('j') | ash/shelf/shelf_layout_manager.cc » ('J')
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 "ash/display/display_change_observer_chromeos.h" 5 #include "ash/display/display_change_observer_chromeos.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 DisplayChangeObserver::~DisplayChangeObserver() { 149 DisplayChangeObserver::~DisplayChangeObserver() {
150 ui::DeviceDataManager::GetInstance()->RemoveObserver(this); 150 ui::DeviceDataManager::GetInstance()->RemoveObserver(this);
151 Shell::GetInstance()->RemoveShellObserver(this); 151 Shell::GetInstance()->RemoveShellObserver(this);
152 } 152 }
153 153
154 ui::MultipleDisplayState DisplayChangeObserver::GetStateForDisplayIds( 154 ui::MultipleDisplayState DisplayChangeObserver::GetStateForDisplayIds(
155 const ui::DisplayConfigurator::DisplayStateList& display_states) const { 155 const ui::DisplayConfigurator::DisplayStateList& display_states) const {
156 UpdateInternalDisplayId(display_states); 156 UpdateInternalDisplayId(display_states);
157 if (display_states.size() != 2) 157 if (display_states.size() != 2)
158 return ui::MULTIPLE_DISPLAY_STATE_DUAL_EXTENDED; 158 return ui::MULTIPLE_DISPLAY_STATE_DUAL_EXTENDED;
159 DisplayIdPair pair = CreateDisplayIdPair(display_states[0]->display_id(), 159 DisplayIdList list = CreateDisplayIdList(display_states[0]->display_id(),
160 display_states[1]->display_id()); 160 display_states[1]->display_id());
161 DisplayLayout layout = Shell::GetInstance()->display_manager()-> 161 DisplayLayout layout = Shell::GetInstance()
162 layout_store()->GetRegisteredDisplayLayout(pair); 162 ->display_manager()
163 ->layout_store()
164 ->GetRegisteredDisplayLayout(list);
163 return layout.mirrored ? ui::MULTIPLE_DISPLAY_STATE_DUAL_MIRROR : 165 return layout.mirrored ? ui::MULTIPLE_DISPLAY_STATE_DUAL_MIRROR :
164 ui::MULTIPLE_DISPLAY_STATE_DUAL_EXTENDED; 166 ui::MULTIPLE_DISPLAY_STATE_DUAL_EXTENDED;
165 } 167 }
166 168
167 bool DisplayChangeObserver::GetResolutionForDisplayId(int64_t display_id, 169 bool DisplayChangeObserver::GetResolutionForDisplayId(int64_t display_id,
168 gfx::Size* size) const { 170 gfx::Size* size) const {
169 DisplayMode mode; 171 DisplayMode mode;
170 if (!Shell::GetInstance()->display_manager()->GetSelectedModeForDisplayId( 172 if (!Shell::GetInstance()->display_manager()->GetSelectedModeForDisplayId(
171 display_id, &mode)) 173 display_id, &mode))
172 return false; 174 return false;
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 } 301 }
300 return 1.0f; 302 return 1.0f;
301 } 303 }
302 304
303 void DisplayChangeObserver::OnTouchscreenDeviceConfigurationChanged() { 305 void DisplayChangeObserver::OnTouchscreenDeviceConfigurationChanged() {
304 OnDisplayModeChanged( 306 OnDisplayModeChanged(
305 Shell::GetInstance()->display_configurator()->cached_displays()); 307 Shell::GetInstance()->display_configurator()->cached_displays());
306 } 308 }
307 309
308 } // namespace ash 310 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/display/display_layout.h » ('j') | ash/shelf/shelf_layout_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698