blob: 32aaf84b5181448c89bbb6db1b68557186dff282 [file] [log] [blame]
[email protected]144b9a92013-07-11 05:48:281// 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]c1234a42013-08-20 09:35:405#include "ash/display/display_error_observer_chromeos.h"
[email protected]144b9a92013-07-11 05:48:286
oshima211a82222016-05-06 20:18:547#include "ash/display/display_util.h"
jamescooke45f8112017-03-02 16:45:428#include "ash/strings/grit/ash_strings.h"
James Cooka35a1e22017-04-08 02:33:089#include "ash/system/devicetype_utils.h"
afakhry0e604432016-02-05 23:08:3410#include "base/strings/string_number_conversions.h"
glevinc6ce8ae2016-12-13 17:42:3711#include "ui/base/l10n/l10n_util.h"
[email protected]144b9a92013-07-11 05:48:2812
13namespace ash {
[email protected]144b9a92013-07-11 05:48:2814
jamescookb8dcef522016-06-25 14:42:5515DisplayErrorObserver::DisplayErrorObserver() {}
[email protected]144b9a92013-07-11 05:48:2816
jamescookb8dcef522016-06-25 14:42:5517DisplayErrorObserver::~DisplayErrorObserver() {}
[email protected]144b9a92013-07-11 05:48:2818
19void DisplayErrorObserver::OnDisplayModeChangeFailed(
kylechar7a067ec2017-01-07 01:16:2820 const display::DisplayConfigurator::DisplayStateList& displays,
21 display::MultipleDisplayState new_state) {
afakhry0e604432016-02-05 23:08:3422 LOG(ERROR) << "Failed to configure the following display(s):";
vmpstr4ee88f992016-07-27 18:17:1323 for (auto* display : displays) {
afakhry0e604432016-02-05 23:08:3424 LOG(ERROR) << "- Display with ID = " << display->display_id()
25 << ", and EDID = " << base::HexEncode(display->edid().data(),
26 display->edid().size())
27 << ".";
28 }
29
glevinc6ce8ae2016-12-13 17:42:3730 base::string16 message =
kylechar7a067ec2017-01-07 01:16:2831 (new_state == display::MULTIPLE_DISPLAY_STATE_DUAL_MIRROR)
glevinc6ce8ae2016-12-13 17:42:3732 ? 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]144b9a92013-07-11 05:48:2836}
37
[email protected]144b9a92013-07-11 05:48:2838} // namespace ash