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 7e2fefdbb4373ca3532e2acbc32a02ad43a3792a..27a1e6abe715ed3e18fb84ac9410cefdd9c47224 100644 |
--- a/chrome/browser/ui/panels/panel_manager.cc |
+++ b/chrome/browser/ui/panels/panel_manager.cc |
@@ -10,6 +10,7 @@ |
#include "base/logging.h" |
#include "base/memory/scoped_ptr.h" |
#include "base/message_loop.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" |
@@ -69,7 +70,8 @@ PanelManager::PanelManager() |
remove_delays_for_testing_(false), |
titlebar_action_factory_(this), |
auto_sizing_enabled_(true), |
- mouse_watching_disabled_(false) { |
+ mouse_watching_disabled_(false), |
+ is_full_screen_mode_on_(false) { |
panel_mouse_watcher_.reset(PanelMouseWatcher::Create()); |
auto_hiding_desktop_bar_ = AutoHidingDesktopBar::Create(this); |
OnDisplayChanged(); |
@@ -152,6 +154,12 @@ Panel* PanelManager::CreatePanel(Browser* browser) { |
content::Source<Panel>(panel), |
content::NotificationService::NoDetails()); |
+ if (num_panels() == 1) { |
dcheng
2011/11/30 01:07:28
Use panels_.size() -- it makes the connection more
jennb
2011/11/30 02:06:27
panels_ is going away. use num_panels().
prasadt
2011/11/30 02:38:47
Done.
prasadt
2011/11/30 02:38:47
See Jenn's comment.
|
+ full_screen_mode_timer_.Start(FROM_HERE, |
+ base::TimeDelta::FromMilliseconds(kFullScreenModeCheckInterval), |
+ this, &PanelManager::CheckFullScreenMode); |
+ } |
+ |
return panel; |
} |
@@ -172,6 +180,16 @@ int PanelManager::GetRightMostAvailablePosition() const { |
(panels_.back()->GetBounds().x() - kPanelsHorizontalSpacing); |
} |
+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; |
+ for (size_t i = 0; i < panels_.size(); ++i) |
+ panels_[i]->FullScreenModeChanged(is_full_screen_mode_on_); |
Dmitry Titov
2011/11/30 01:35:53
if you do panel->native_panel()->FooBar() here, yo
prasadt
2011/11/30 02:38:47
Currently PanelManager does not access native_pane
Dmitry Titov
2011/12/01 04:04:26
What would be the reason for such separation? Nati
prasadt
2011/12/01 04:20:48
Done.
NativePanel interface is currently protecte
jennb
2011/12/01 21:22:09
Another reason for the separation is that the Pane
prasadt
2011/12/01 21:35:16
Now that I think about it, this makes sense to me.
|
+} |
+ |
void PanelManager::Remove(Panel* panel) { |
// If we're in the process of dragging, delay the removal. |
if (dragging_panel_index_ != kInvalidPanelIndex) { |
@@ -203,6 +221,9 @@ void PanelManager::DoRemove(Panel* panel) { |
chrome::NOTIFICATION_PANEL_REMOVED, |
content::Source<Panel>(panel), |
content::NotificationService::NoDetails()); |
+ |
+ if (num_panels() == 0) |
dcheng
2011/11/30 01:07:28
Use panels_.empty().
jennb
2011/11/30 02:06:27
Ditto.
prasadt
2011/11/30 02:38:47
Done.
prasadt
2011/11/30 02:38:47
See Jenn's comment.
|
+ full_screen_mode_timer_.Stop(); |
} |
void PanelManager::StartDragging(Panel* panel) { |