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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 } | 204 } |
205 } else { | 205 } else { |
206 DisplayMode mode; | 206 DisplayMode mode; |
207 if (Shell::GetInstance()->display_manager()->GetSelectedModeForDisplayId( | 207 if (Shell::GetInstance()->display_manager()->GetSelectedModeForDisplayId( |
208 state.display->display_id(), &mode)) { | 208 state.display->display_id(), &mode)) { |
209 device_scale_factor = mode.device_scale_factor; | 209 device_scale_factor = mode.device_scale_factor; |
210 } | 210 } |
211 } | 211 } |
212 gfx::Rect display_bounds(state.display->origin(), mode_info->size()); | 212 gfx::Rect display_bounds(state.display->origin(), mode_info->size()); |
213 | 213 |
214 std::string name = | 214 std::string name; |
215 state.display->type() == ui::DISPLAY_CONNECTION_TYPE_INTERNAL ? | 215 switch (state.display->type()) { |
216 l10n_util::GetStringUTF8(IDS_ASH_INTERNAL_DISPLAY_NAME) : | 216 case ui::DISPLAY_CONNECTION_TYPE_INTERNAL: |
217 state.display->display_name(); | 217 name = l10n_util::GetStringUTF8(IDS_ASH_INTERNAL_DISPLAY_NAME); |
| 218 break; |
| 219 case ui::DISPLAY_CONNECTION_TYPE_VIRTUAL: |
| 220 name = l10n_util::GetStringUTF8(IDS_ASH_VIRTUAL_DISPLAY_NAME); |
| 221 break; |
| 222 default: |
| 223 name = state.display->display_name(); |
| 224 } |
| 225 |
218 if (name.empty()) | 226 if (name.empty()) |
219 name = l10n_util::GetStringUTF8(IDS_ASH_STATUS_TRAY_UNKNOWN_DISPLAY_NAME); | 227 name = l10n_util::GetStringUTF8(IDS_ASH_STATUS_TRAY_UNKNOWN_DISPLAY_NAME); |
220 | 228 |
221 bool has_overscan = state.display->has_overscan(); | 229 bool has_overscan = state.display->has_overscan(); |
222 int64 id = state.display->display_id(); | 230 int64 id = state.display->display_id(); |
223 ids.insert(id); | 231 ids.insert(id); |
224 | 232 |
225 displays.push_back(DisplayInfo(id, name, has_overscan)); | 233 displays.push_back(DisplayInfo(id, name, has_overscan)); |
226 DisplayInfo& new_info = displays.back(); | 234 DisplayInfo& new_info = displays.back(); |
227 new_info.set_device_scale_factor(device_scale_factor); | 235 new_info.set_device_scale_factor(device_scale_factor); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 void DisplayChangeObserver::OnKeyboardDeviceConfigurationChanged() { | 288 void DisplayChangeObserver::OnKeyboardDeviceConfigurationChanged() { |
281 } | 289 } |
282 | 290 |
283 void DisplayChangeObserver::OnMouseDeviceConfigurationChanged() { | 291 void DisplayChangeObserver::OnMouseDeviceConfigurationChanged() { |
284 } | 292 } |
285 | 293 |
286 void DisplayChangeObserver::OnTouchpadDeviceConfigurationChanged() { | 294 void DisplayChangeObserver::OnTouchpadDeviceConfigurationChanged() { |
287 } | 295 } |
288 | 296 |
289 } // namespace ash | 297 } // namespace ash |
OLD | NEW |