diff options
author | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-13 07:35:27 +0000 |
---|---|---|
committer | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-13 07:35:27 +0000 |
commit | 7e39285433ef15bd7f932ea216ee043146620858 (patch) | |
tree | 0448d9e300c457f2fb936e4c04fac7589da1eda3 /chrome/browser/ui/panels/display_settings_provider.cc | |
parent | 8806d3bc0b213bac2a6e6cd6f53682fe92f56177 (diff) | |
download | chromium_src-7e39285433ef15bd7f932ea216ee043146620858.zip chromium_src-7e39285433ef15bd7f932ea216ee043146620858.tar.gz chromium_src-7e39285433ef15bd7f932ea216ee043146620858.tar.bz2 |
Revert 132144 - Broke ASAN
Move full-screen detection logic from PanelManager to DisplaySettingsProvider.
Also fixed a bug that pnels remain visible with full screen apps on Snow Leopard.
The fix is to also call orderBack/orderFront when full-screen is detected. This is because the full-sreen window is still in normal level and our panel windows stay in the top of z-order when its level is changed to normal.
BUG=123058
TEST=Manual test by launching panels and make an app full-screen
Review URL: http://codereview.chromium.org/10051020
TBR=jianli@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10066041
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132153 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 | 67 |
1 files changed, 4 insertions, 63 deletions
diff --git a/chrome/browser/ui/panels/display_settings_provider.cc b/chrome/browser/ui/panels/display_settings_provider.cc index b2fed3f..af3ee88 100644 --- a/chrome/browser/ui/panels/display_settings_provider.cc +++ b/chrome/browser/ui/panels/display_settings_provider.cc @@ -5,61 +5,16 @@ #include "chrome/browser/ui/panels/display_settings_provider.h" #include "base/logging.h" -#include "chrome/browser/fullscreen.h" #include "ui/gfx/screen.h" -namespace { -// The polling interval to check any display settings change, like full-screen -// mode changes. -const int kFullScreenModeCheckIntervalMs = 1000; -} // namespace - DisplaySettingsProvider::DisplaySettingsProvider() - : is_full_screen_(false) { + : display_area_observer_(NULL), + desktop_bar_observer_(NULL) { } DisplaySettingsProvider::~DisplaySettingsProvider() { } -void DisplaySettingsProvider::AddDisplayAreaObserver( - DisplayAreaObserver* observer) { - display_area_observers_.AddObserver(observer); -} - -void DisplaySettingsProvider::RemoveDisplayAreaObserver( - DisplayAreaObserver* observer) { - display_area_observers_.RemoveObserver(observer); -} - -void DisplaySettingsProvider::AddDesktopBarObserver( - DesktopBarObserver* observer) { - desktop_bar_observers_.AddObserver(observer); -} - -void DisplaySettingsProvider::RemoveDesktopBarObserver( - DesktopBarObserver* observer) { - desktop_bar_observers_.RemoveObserver(observer); -} - -void DisplaySettingsProvider::AddFullScreenObserver( - FullScreenObserver* observer) { - full_screen_observers_.AddObserver(observer); - - if (full_screen_observers_.size() == 1) { - full_screen_mode_timer_.Start(FROM_HERE, - base::TimeDelta::FromMilliseconds(kFullScreenModeCheckIntervalMs), - this, &DisplaySettingsProvider::CheckFullScreenMode); - } -} - -void DisplaySettingsProvider::RemoveFullScreenObserver( - FullScreenObserver* observer) { - full_screen_observers_.RemoveObserver(observer); - - if (full_screen_observers_.size() == 0) - full_screen_mode_timer_.Stop(); -} - gfx::Rect DisplaySettingsProvider::GetDisplayArea() { // Do the first-time initialization if not yet. if (adjusted_work_area_.IsEmpty()) @@ -92,11 +47,8 @@ void DisplaySettingsProvider::OnAutoHidingDesktopBarChanged() { gfx::Rect old_adjusted_work_area = adjusted_work_area_; AdjustWorkAreaForAutoHidingDesktopBars(); - if (old_adjusted_work_area != adjusted_work_area_) { - FOR_EACH_OBSERVER(DisplayAreaObserver, - display_area_observers_, - OnDisplayAreaChanged(adjusted_work_area_)); - } + if (old_adjusted_work_area != adjusted_work_area_ && display_area_observer_) + display_area_observer_->OnDisplayAreaChanged(adjusted_work_area_); } bool DisplaySettingsProvider::IsAutoHidingDesktopBarEnabled( @@ -135,17 +87,6 @@ void DisplaySettingsProvider::AdjustWorkAreaForAutoHidingDesktopBars() { } } -void DisplaySettingsProvider::CheckFullScreenMode() { - bool is_full_screen = IsFullScreenMode(); - if (is_full_screen == is_full_screen_) - return; - is_full_screen_ = is_full_screen; - - FOR_EACH_OBSERVER(FullScreenObserver, - full_screen_observers_, - OnFullScreenModeChanged(is_full_screen_)); -} - #if defined(USE_AURA) // static DisplaySettingsProvider* DisplaySettingsProvider::Create() { |