diff options
author | jianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-07 01:31:51 +0000 |
---|---|---|
committer | jianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-07 01:31:51 +0000 |
commit | 0d51a83cf10a188cc395b9babb27dfcb9ef301b1 (patch) | |
tree | 1cd5622de6e45a88ba6604d1ac3dc13a2e1b8b14 /chrome/browser/ui/panels/display_settings_provider.cc | |
parent | b67d228f078e4084b9342a2b424d370e0e8eb726 (diff) | |
download | chromium_src-0d51a83cf10a188cc395b9babb27dfcb9ef301b1.zip chromium_src-0d51a83cf10a188cc395b9babb27dfcb9ef301b1.tar.gz chromium_src-0d51a83cf10a188cc395b9babb27dfcb9ef301b1.tar.bz2 |
Fix bug 114813: Resolution/screen configuration changes are missed if no panels exist during the change
BUG=114813
TEST=Manual test by closing all panels, changing resolution and opening a new panel
Review URL: http://codereview.chromium.org/9395059
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125278 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/panels/display_settings_provider.cc')
-rw-r--r-- | chrome/browser/ui/panels/display_settings_provider.cc | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/chrome/browser/ui/panels/display_settings_provider.cc b/chrome/browser/ui/panels/display_settings_provider.cc new file mode 100644 index 0000000..05c0dc5 --- /dev/null +++ b/chrome/browser/ui/panels/display_settings_provider.cc @@ -0,0 +1,59 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ui/panels/display_settings_provider.h" + +#include "base/logging.h" +#include "ui/gfx/screen.h" + +DisplaySettingsProvider::DisplaySettingsProvider(Observer* observer) + : observer_(observer) { + DCHECK(observer); +} + +DisplaySettingsProvider::~DisplaySettingsProvider() { +} + +gfx::Rect DisplaySettingsProvider::GetWorkArea() { +#if defined(OS_MACOSX) + // On OSX, panels should be dropped all the way to the bottom edge of the + // screen (and overlap Dock). + gfx::Rect work_area = gfx::Screen::GetPrimaryMonitorBounds(); +#else + gfx::Rect work_area = gfx::Screen::GetPrimaryMonitorWorkArea(); +#endif + + if (work_area_ != work_area) { + work_area_ = work_area; + OnWorkAreaChanged(); + } + + return work_area; +} + +void DisplaySettingsProvider::OnWorkAreaChanged() { +} + +bool DisplaySettingsProvider::IsAutoHidingDesktopBarEnabled( + DesktopBarAlignment alignment) { + return false; +} + +int DisplaySettingsProvider::GetDesktopBarThickness( + DesktopBarAlignment alignment) const { + return 0; +} + +DisplaySettingsProvider::DesktopBarVisibility +DisplaySettingsProvider::GetDesktopBarVisibility( + DesktopBarAlignment alignment) const { + return DESKTOP_BAR_VISIBLE; +} + +#if !defined(OS_WIN) +// static +DisplaySettingsProvider* DisplaySettingsProvider::Create(Observer* observer) { + return new DisplaySettingsProvider(observer); +} +#endif |