Chromium Code Reviews| Index: chrome/browser/ui/panels/panel_manager.cc |
| diff --git a/chrome/browser/ui/panels/panel_manager.cc b/chrome/browser/ui/panels/panel_manager.cc |
| index ae5bbe22801b42eaf74ecd6ded6ad688ff0ced65..889dbe8c2132d61e927377cd5b691b4a8c60bc27 100644 |
| --- a/chrome/browser/ui/panels/panel_manager.cc |
| +++ b/chrome/browser/ui/panels/panel_manager.cc |
| @@ -6,6 +6,7 @@ |
| #include "base/logging.h" |
| #include "base/memory/scoped_ptr.h" |
| +#include "chrome/browser/fullscreen.h" |
| #include "chrome/browser/ui/browser.h" |
| #include "chrome/browser/ui/browser_list.h" |
| #include "chrome/browser/ui/panels/panel_mouse_watcher.h" |
| @@ -25,6 +26,8 @@ const int kPanelStripRightMargin = 24; |
| // Height of panel strip is based on the factor of the working area. |
| const double kPanelStripHeightFactor = 0.5; |
| +static const int kFullScreenModeCheckInterval = 1000; |
|
jianli
2011/12/02 00:04:45
nit: either add comment to mention ms or add ms su
prasadt
2011/12/02 00:29:39
Done.
|
| + |
| } // namespace |
| // static |
| @@ -35,7 +38,8 @@ PanelManager* PanelManager::GetInstance() { |
| PanelManager::PanelManager() |
| : panel_mouse_watcher_(PanelMouseWatcher::Create()), |
| - auto_sizing_enabled_(true) { |
| + auto_sizing_enabled_(true), |
| + is_full_screen_mode_on_(false) { |
| panel_strip_.reset(new PanelStrip(this)); |
| auto_hiding_desktop_bar_ = AutoHidingDesktopBar::Create(this); |
| OnDisplayChanged(); |
| @@ -90,6 +94,12 @@ Panel* PanelManager::CreatePanel(Browser* browser) { |
| content::Source<Panel>(panel), |
| content::NotificationService::NoDetails()); |
| + if (num_panels() == 1) { |
| + full_screen_mode_timer_.Start(FROM_HERE, |
| + base::TimeDelta::FromMilliseconds(kFullScreenModeCheckInterval), |
| + this, &PanelManager::CheckFullScreenMode); |
| + } |
| + |
| return panel; |
| } |
| @@ -97,6 +107,14 @@ int PanelManager::StartingRightPosition() const { |
| return panel_strip_->StartingRightPosition(); |
| } |
| +void PanelManager::CheckFullScreenMode() { |
| + bool is_full_screen_mode_on_new = IsFullScreenMode(); |
| + if (is_full_screen_mode_on_ == is_full_screen_mode_on_new) |
| + return; |
| + is_full_screen_mode_on_ = is_full_screen_mode_on_new; |
| + panel_strip_->OnFullScreenModeChanged(is_full_screen_mode_on_); |
| +} |
| + |
| void PanelManager::Remove(Panel* panel) { |
| if (panel_strip_->Remove(panel)) |
| return; |
| @@ -108,6 +126,9 @@ void PanelManager::OnPanelRemoved(Panel* panel) { |
| chrome::NOTIFICATION_PANEL_REMOVED, |
| content::Source<Panel>(panel), |
| content::NotificationService::NoDetails()); |
| + |
| + if (num_panels() == 0) |
| + full_screen_mode_timer_.Stop(); |
| } |
| void PanelManager::StartDragging(Panel* panel) { |