| 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 "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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |