[email protected] | 144b9a9 | 2013-07-11 05:48:28 | [diff] [blame] | 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 | ||||
3 | // found in the LICENSE file. | ||||
4 | |||||
[email protected] | c1234a4 | 2013-08-20 09:35:40 | [diff] [blame] | 5 | #include "ash/display/display_error_observer_chromeos.h" |
[email protected] | 144b9a9 | 2013-07-11 05:48:28 | [diff] [blame] | 6 | |
oshima | 211a8222 | 2016-05-06 20:18:54 | [diff] [blame] | 7 | #include "ash/display/display_util.h" |
jamescook | e45f811 | 2017-03-02 16:45:42 | [diff] [blame] | 8 | #include "ash/strings/grit/ash_strings.h" |
James Cook | a35a1e2 | 2017-04-08 02:33:08 | [diff] [blame^] | 9 | #include "ash/system/devicetype_utils.h" |
afakhry | 0e60443 | 2016-02-05 23:08:34 | [diff] [blame] | 10 | #include "base/strings/string_number_conversions.h" |
glevin | c6ce8ae | 2016-12-13 17:42:37 | [diff] [blame] | 11 | #include "ui/base/l10n/l10n_util.h" |
[email protected] | 144b9a9 | 2013-07-11 05:48:28 | [diff] [blame] | 12 | |
13 | namespace ash { | ||||
[email protected] | 144b9a9 | 2013-07-11 05:48:28 | [diff] [blame] | 14 | |
jamescook | b8dcef52 | 2016-06-25 14:42:55 | [diff] [blame] | 15 | DisplayErrorObserver::DisplayErrorObserver() {} |
[email protected] | 144b9a9 | 2013-07-11 05:48:28 | [diff] [blame] | 16 | |
jamescook | b8dcef52 | 2016-06-25 14:42:55 | [diff] [blame] | 17 | DisplayErrorObserver::~DisplayErrorObserver() {} |
[email protected] | 144b9a9 | 2013-07-11 05:48:28 | [diff] [blame] | 18 | |
19 | void DisplayErrorObserver::OnDisplayModeChangeFailed( | ||||
kylechar | 7a067ec | 2017-01-07 01:16:28 | [diff] [blame] | 20 | const display::DisplayConfigurator::DisplayStateList& displays, |
21 | display::MultipleDisplayState new_state) { | ||||
afakhry | 0e60443 | 2016-02-05 23:08:34 | [diff] [blame] | 22 | LOG(ERROR) << "Failed to configure the following display(s):"; |
vmpstr | 4ee88f99 | 2016-07-27 18:17:13 | [diff] [blame] | 23 | for (auto* display : displays) { |
afakhry | 0e60443 | 2016-02-05 23:08:34 | [diff] [blame] | 24 | LOG(ERROR) << "- Display with ID = " << display->display_id() |
25 | << ", and EDID = " << base::HexEncode(display->edid().data(), | ||||
26 | display->edid().size()) | ||||
27 | << "."; | ||||
28 | } | ||||
29 | |||||
glevin | c6ce8ae | 2016-12-13 17:42:37 | [diff] [blame] | 30 | base::string16 message = |
kylechar | 7a067ec | 2017-01-07 01:16:28 | [diff] [blame] | 31 | (new_state == display::MULTIPLE_DISPLAY_STATE_DUAL_MIRROR) |
glevin | c6ce8ae | 2016-12-13 17:42:37 | [diff] [blame] | 32 | ? l10n_util::GetStringUTF16(IDS_ASH_DISPLAY_FAILURE_ON_MIRRORING) |
33 | : ash::SubstituteChromeOSDeviceType( | ||||
34 | IDS_ASH_DISPLAY_FAILURE_ON_NON_MIRRORING); | ||||
35 | ShowDisplayErrorNotification(message, true); | ||||
[email protected] | 144b9a9 | 2013-07-11 05:48:28 | [diff] [blame] | 36 | } |
37 | |||||
[email protected] | 144b9a9 | 2013-07-11 05:48:28 | [diff] [blame] | 38 | } // namespace ash |