| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/system/chromeos/tray_display.h" | 5 #include "ash/system/chromeos/tray_display.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "ash/content/display/screen_orientation_controller_chromeos.h" | 9 #include "ash/content/display/screen_orientation_controller_chromeos.h" |
| 10 #include "ash/display/display_controller.h" | 10 #include "ash/display/display_controller.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 GetDisplayManager()->GetDisplayNameForId(display_id)); | 45 GetDisplayManager()->GetDisplayNameForId(display_id)); |
| 46 } | 46 } |
| 47 | 47 |
| 48 base::string16 GetDisplaySize(int64 display_id) { | 48 base::string16 GetDisplaySize(int64 display_id) { |
| 49 DisplayManager* display_manager = GetDisplayManager(); | 49 DisplayManager* display_manager = GetDisplayManager(); |
| 50 | 50 |
| 51 const gfx::Display* display = &display_manager->GetDisplayForId(display_id); | 51 const gfx::Display* display = &display_manager->GetDisplayForId(display_id); |
| 52 | 52 |
| 53 // We don't show display size for mirrored display. Fallback | 53 // We don't show display size for mirrored display. Fallback |
| 54 // to empty string if this happens on release build. | 54 // to empty string if this happens on release build. |
| 55 bool mirrored_display = display_manager->mirrored_display_id() == display_id; | 55 bool mirrored_display = display_manager->mirroring_display_id() == display_id; |
| 56 DCHECK(!mirrored_display); | 56 DCHECK(!mirrored_display); |
| 57 if (mirrored_display) | 57 if (mirrored_display) |
| 58 return base::string16(); | 58 return base::string16(); |
| 59 | 59 |
| 60 DCHECK(display->is_valid()); | 60 DCHECK(display->is_valid()); |
| 61 return base::UTF8ToUTF16(display->size().ToString()); | 61 return base::UTF8ToUTF16(display->size().ToString()); |
| 62 } | 62 } |
| 63 | 63 |
| 64 // Returns 1-line information for the specified display, like | 64 // Returns 1-line information for the specified display, like |
| 65 // "InternalDisplay: 1280x750" | 65 // "InternalDisplay: 1280x750" |
| 66 base::string16 GetDisplayInfoLine(int64 display_id) { | 66 base::string16 GetDisplayInfoLine(int64 display_id) { |
| 67 const DisplayInfo& display_info = | 67 const DisplayInfo& display_info = |
| 68 GetDisplayManager()->GetDisplayInfo(display_id); | 68 GetDisplayManager()->GetDisplayInfo(display_id); |
| 69 if (GetDisplayManager()->mirrored_display_id() == display_id) | 69 if (GetDisplayManager()->mirroring_display_id() == display_id) |
| 70 return GetDisplayName(display_id); | 70 return GetDisplayName(display_id); |
| 71 | 71 |
| 72 base::string16 size_text = GetDisplaySize(display_id); | 72 base::string16 size_text = GetDisplaySize(display_id); |
| 73 base::string16 display_data; | 73 base::string16 display_data; |
| 74 if (display_info.has_overscan()) { | 74 if (display_info.has_overscan()) { |
| 75 display_data = l10n_util::GetStringFUTF16( | 75 display_data = l10n_util::GetStringFUTF16( |
| 76 IDS_ASH_STATUS_TRAY_DISPLAY_ANNOTATION, | 76 IDS_ASH_STATUS_TRAY_DISPLAY_ANNOTATION, |
| 77 size_text, | 77 size_text, |
| 78 l10n_util::GetStringUTF16( | 78 l10n_util::GetStringUTF16( |
| 79 IDS_ASH_STATUS_TRAY_DISPLAY_ANNOTATION_OVERSCAN)); | 79 IDS_ASH_STATUS_TRAY_DISPLAY_ANNOTATION_OVERSCAN)); |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 IDS_ASH_STATUS_TRAY_DISPLAY_EXTENDED, GetExternalDisplayName()); | 233 IDS_ASH_STATUS_TRAY_DISPLAY_EXTENDED, GetExternalDisplayName()); |
| 234 } | 234 } |
| 235 return l10n_util::GetStringUTF16( | 235 return l10n_util::GetStringUTF16( |
| 236 IDS_ASH_STATUS_TRAY_DISPLAY_EXTENDED_NO_INTERNAL); | 236 IDS_ASH_STATUS_TRAY_DISPLAY_EXTENDED_NO_INTERNAL); |
| 237 } | 237 } |
| 238 | 238 |
| 239 if (display_manager->IsMirrored()) { | 239 if (display_manager->IsMirrored()) { |
| 240 if (GetDisplayManager()->HasInternalDisplay()) { | 240 if (GetDisplayManager()->HasInternalDisplay()) { |
| 241 return l10n_util::GetStringFUTF16( | 241 return l10n_util::GetStringFUTF16( |
| 242 IDS_ASH_STATUS_TRAY_DISPLAY_MIRRORING, | 242 IDS_ASH_STATUS_TRAY_DISPLAY_MIRRORING, |
| 243 GetDisplayName(display_manager->mirrored_display_id())); | 243 GetDisplayName(display_manager->mirroring_display_id())); |
| 244 } | 244 } |
| 245 return l10n_util::GetStringUTF16( | 245 return l10n_util::GetStringUTF16( |
| 246 IDS_ASH_STATUS_TRAY_DISPLAY_MIRRORING_NO_INTERNAL); | 246 IDS_ASH_STATUS_TRAY_DISPLAY_MIRRORING_NO_INTERNAL); |
| 247 } | 247 } |
| 248 | 248 |
| 249 int64 primary_id = Shell::GetScreen()->GetPrimaryDisplay().id(); | 249 int64 primary_id = Shell::GetScreen()->GetPrimaryDisplay().id(); |
| 250 if (display_manager->HasInternalDisplay() && | 250 if (display_manager->HasInternalDisplay() && |
| 251 !display_manager->IsInternalDisplayId(primary_id)) { | 251 !display_manager->IsInternalDisplayId(primary_id)) { |
| 252 if (additional_message_out) { | 252 if (additional_message_out) { |
| 253 *additional_message_out = l10n_util::GetStringUTF16( | 253 *additional_message_out = l10n_util::GetStringUTF16( |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 bool TrayDisplay::GetAccessibleStateForTesting(ui::AXViewState* state) { | 443 bool TrayDisplay::GetAccessibleStateForTesting(ui::AXViewState* state) { |
| 444 views::View* view = default_; | 444 views::View* view = default_; |
| 445 if (view) { | 445 if (view) { |
| 446 view->GetAccessibleState(state); | 446 view->GetAccessibleState(state); |
| 447 return true; | 447 return true; |
| 448 } | 448 } |
| 449 return false; | 449 return false; |
| 450 } | 450 } |
| 451 | 451 |
| 452 } // namespace ash | 452 } // namespace ash |
| OLD | NEW |