Chromium Code Reviews| 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 <vector> | 10 #include <vector> |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 150 output.display->type() == ui::OUTPUT_TYPE_INTERNAL | 150 output.display->type() == ui::OUTPUT_TYPE_INTERNAL |
| 151 ? l10n_util::GetStringUTF8(IDS_ASH_INTERNAL_DISPLAY_NAME) : | 151 ? l10n_util::GetStringUTF8(IDS_ASH_INTERNAL_DISPLAY_NAME) : |
| 152 output.display->GetDisplayName(); | 152 output.display->GetDisplayName(); |
| 153 if (name.empty()) | 153 if (name.empty()) |
| 154 name = l10n_util::GetStringUTF8(IDS_ASH_STATUS_TRAY_UNKNOWN_DISPLAY_NAME); | 154 name = l10n_util::GetStringUTF8(IDS_ASH_STATUS_TRAY_UNKNOWN_DISPLAY_NAME); |
| 155 | 155 |
| 156 bool has_overscan = output.display->GetOverscanFlag(); | 156 bool has_overscan = output.display->GetOverscanFlag(); |
| 157 int64 id = output.display->display_id(); | 157 int64 id = output.display->display_id(); |
| 158 ids.insert(id); | 158 ids.insert(id); |
| 159 | 159 |
| 160 displays.push_back(DisplayInfo(id, name, has_overscan)); | 160 displays.push_back(DisplayInfo(id, name, has_overscan)); |
|
oshima
2014/03/21 23:37:10
The list is getting longer. Can you get the refere
Jun Mukai
2014/03/22 00:20:29
Done.
| |
| 161 displays.back().set_device_scale_factor(device_scale_factor); | 161 displays.back().set_device_scale_factor(device_scale_factor); |
| 162 displays.back().SetBounds(display_bounds); | 162 displays.back().SetBounds(display_bounds); |
| 163 displays.back().set_native(true); | 163 displays.back().set_native(true); |
| 164 displays.back().set_display_modes(display_modes); | 164 displays.back().set_display_modes(display_modes); |
| 165 displays.back().set_touch_support( | 165 displays.back().set_touch_support( |
| 166 output.touch_device_id == 0 ? gfx::Display::TOUCH_SUPPORT_UNAVAILABLE : | 166 output.touch_device_id == 0 ? gfx::Display::TOUCH_SUPPORT_UNAVAILABLE : |
| 167 gfx::Display::TOUCH_SUPPORT_AVAILABLE); | 167 gfx::Display::TOUCH_SUPPORT_AVAILABLE); |
| 168 displays.back().set_available_color_profiles( | 168 std::vector<ui::ColorCalibrationProfile> available_profiles; |
| 169 output.available_color_profiles); | 169 Shell::GetInstance()->output_configurator()-> |
| 170 GetAvailableColorCalibrationProfiles(id, &available_profiles); | |
| 171 displays.back().set_available_color_profiles(available_profiles); | |
| 170 } | 172 } |
| 171 | 173 |
| 172 // DisplayManager can be null during the boot. | 174 // DisplayManager can be null during the boot. |
| 173 Shell::GetInstance()->display_manager()->OnNativeDisplaysChanged(displays); | 175 Shell::GetInstance()->display_manager()->OnNativeDisplaysChanged(displays); |
| 174 } | 176 } |
| 175 | 177 |
| 176 void DisplayChangeObserver::OnAppTerminating() { | 178 void DisplayChangeObserver::OnAppTerminating() { |
| 177 #if defined(USE_ASH) | 179 #if defined(USE_ASH) |
| 178 // Stop handling display configuration events once the shutdown | 180 // Stop handling display configuration events once the shutdown |
| 179 // process starts. crbug.com/177014. | 181 // process starts. crbug.com/177014. |
| 180 Shell::GetInstance()->output_configurator()->PrepareForExit(); | 182 Shell::GetInstance()->output_configurator()->PrepareForExit(); |
| 181 #endif | 183 #endif |
| 182 } | 184 } |
| 183 | 185 |
| 184 } // namespace internal | 186 } // namespace internal |
| 185 } // namespace ash | 187 } // namespace ash |
| OLD | NEW |