diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-16 08:15:43 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-16 08:15:43 +0000 |
commit | 1e363fbe0d420fee6b6347179d20a32aa2210ba8 (patch) | |
tree | 25467ceddbf809d46d784fe9d8b7622c3220207c /ash | |
parent | 8ea53f9a0a3db61656a81706da2469a895e63cb7 (diff) | |
download | chromium_src-1e363fbe0d420fee6b6347179d20a32aa2210ba8.zip chromium_src-1e363fbe0d420fee6b6347179d20a32aa2210ba8.tar.gz chromium_src-1e363fbe0d420fee6b6347179d20a32aa2210ba8.tar.bz2 |
Use the default display when there is no display connected, as it used to be.
This is regression in r211047. This is a bit better now as chrome uses
the same fallback on both device and desktop.
BUG=259901
TEST=covered by test. (test crashes without change in OnNativeDisplayChanged)
R=derat@chromium.org
Review URL: https://codereview.chromium.org/19271004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211775 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r-- | ash/display/display_manager.cc | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/ash/display/display_manager.cc b/ash/display/display_manager.cc index b4d9580..6ee1bde 100644 --- a/ash/display/display_manager.cc +++ b/ash/display/display_manager.cc @@ -201,10 +201,6 @@ void DisplayManager::InitFromCommandLine() { iter != parts.end(); ++iter) { info_list.push_back(DisplayInfo::CreateFromSpec(*iter)); } - if (info_list.empty()) { - info_list.push_back( - DisplayInfo::CreateFromSpec(std::string() /* default */)); - } CommandLine* command_line = CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(switches::kAshUseFirstDisplayAsInternal)) gfx::Display::SetInternalDisplayId(info_list[0].id()); @@ -390,16 +386,25 @@ gfx::Insets DisplayManager::GetOverscanInsets(int64 display_id) const { void DisplayManager::OnNativeDisplaysChanged( const std::vector<DisplayInfo>& updated_displays) { if (updated_displays.empty()) { - // Don't update the displays when all displays are disconnected. - // This happens when: - // - the device is idle and powerd requested to turn off all displays. - // - the device is suspended. (kernel turns off all displays) - // - the internal display's brightness is set to 0 and no external - // display is connected. - // - the internal display's brightness is 0 and external display is - // disconnected. - // The display will be updated when one of displays is turned on, and the - // display list will be updated correctly. + // If the device is booted without display, or chrome is started + // without --ash-host-window-bounds on linux desktop, use the + // default display. + if (displays_.empty()) { + std::vector<DisplayInfo> init_displays; + init_displays.push_back(DisplayInfo::CreateFromSpec(std::string())); + OnNativeDisplaysChanged(init_displays); + } else { + // Otherwise don't update the displays when all displays are disconnected. + // This happens when: + // - the device is idle and powerd requested to turn off all displays. + // - the device is suspended. (kernel turns off all displays) + // - the internal display's brightness is set to 0 and no external + // display is connected. + // - the internal display's brightness is 0 and external display is + // disconnected. + // The display will be updated when one of displays is turned on, and the + // display list will be updated correctly. + } return; } first_display_id_ = updated_displays[0].id(); |