| 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_error_observer_chromeos.h" | 5 #include "ash/display/display_error_observer_chromeos.h" |
| 6 | 6 |
| 7 #include "ash/common/system/chromeos/devicetype_utils.h" |
| 7 #include "ash/display/display_util.h" | 8 #include "ash/display/display_util.h" |
| 8 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 9 #include "grit/ash_strings.h" | 10 #include "grit/ash_strings.h" |
| 11 #include "ui/base/l10n/l10n_util.h" |
| 10 | 12 |
| 11 namespace ash { | 13 namespace ash { |
| 12 | 14 |
| 13 DisplayErrorObserver::DisplayErrorObserver() {} | 15 DisplayErrorObserver::DisplayErrorObserver() {} |
| 14 | 16 |
| 15 DisplayErrorObserver::~DisplayErrorObserver() {} | 17 DisplayErrorObserver::~DisplayErrorObserver() {} |
| 16 | 18 |
| 17 void DisplayErrorObserver::OnDisplayModeChangeFailed( | 19 void DisplayErrorObserver::OnDisplayModeChangeFailed( |
| 18 const ui::DisplayConfigurator::DisplayStateList& displays, | 20 const ui::DisplayConfigurator::DisplayStateList& displays, |
| 19 ui::MultipleDisplayState new_state) { | 21 ui::MultipleDisplayState new_state) { |
| 20 LOG(ERROR) << "Failed to configure the following display(s):"; | 22 LOG(ERROR) << "Failed to configure the following display(s):"; |
| 21 for (auto* display : displays) { | 23 for (auto* display : displays) { |
| 22 LOG(ERROR) << "- Display with ID = " << display->display_id() | 24 LOG(ERROR) << "- Display with ID = " << display->display_id() |
| 23 << ", and EDID = " << base::HexEncode(display->edid().data(), | 25 << ", and EDID = " << base::HexEncode(display->edid().data(), |
| 24 display->edid().size()) | 26 display->edid().size()) |
| 25 << "."; | 27 << "."; |
| 26 } | 28 } |
| 27 | 29 |
| 28 ShowDisplayErrorNotification( | 30 base::string16 message = |
| 29 (new_state == ui::MULTIPLE_DISPLAY_STATE_DUAL_MIRROR) | 31 (new_state == ui::MULTIPLE_DISPLAY_STATE_DUAL_MIRROR) |
| 30 ? IDS_ASH_DISPLAY_FAILURE_ON_MIRRORING | 32 ? l10n_util::GetStringUTF16(IDS_ASH_DISPLAY_FAILURE_ON_MIRRORING) |
| 31 : IDS_ASH_DISPLAY_FAILURE_ON_NON_MIRRORING); | 33 : ash::SubstituteChromeOSDeviceType( |
| 34 IDS_ASH_DISPLAY_FAILURE_ON_NON_MIRRORING); |
| 35 ShowDisplayErrorNotification(message, true); |
| 32 } | 36 } |
| 33 | 37 |
| 34 } // namespace ash | 38 } // namespace ash |
| OLD | NEW |