Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(755)

Unified Diff: chrome/browser/ui/panels/panel_manager.cc

Issue 9699036: Fix handling of minimized panel count (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: comment Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/panels/panel.cc ('k') | chrome/browser/ui/panels/panel_overflow_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c50a6dbbd9913c4583c3794132635af48705084d..55029b0cc7a3c15b819b1a918f42572f50a24441 100644
--- a/chrome/browser/ui/panels/panel_manager.cc
+++ b/chrome/browser/ui/panels/panel_manager.cc
@@ -169,17 +169,33 @@ void PanelManager::EndDragging(bool cancelled) {
}
void PanelManager::OnPanelExpansionStateChanged(Panel* panel) {
- docked_strip_->OnPanelExpansionStateChanged(panel);
+ // For panels outside of the docked strip changing state is a no-op.
+ // But since this method may be called for panels in other strips
+ // we need to check this condition.
+ if (panel->panel_strip() == docked_strip_.get())
+ docked_strip_->OnPanelExpansionStateChanged(panel);
+
}
void PanelManager::OnWindowAutoResized(Panel* panel,
const gfx::Size& preferred_window_size) {
DCHECK(auto_sizing_enabled_);
- docked_strip_->ResizePanelWindow(panel, preferred_window_size);
+ // Even though overflow panels are always minimized, we need
+ // to keep track of their size to put them back into the
+ // docked strip when they fit. So the docked panel strip manages
+ // the size of panels for the overflow strip as well.
+ if (panel->panel_strip() == overflow_strip_.get())
+ docked_strip_->ResizePanelWindow(panel, preferred_window_size);
+ else
+ panel->panel_strip()->ResizePanelWindow(panel, preferred_window_size);
}
void PanelManager::ResizePanel(Panel* panel, const gfx::Size& new_size) {
- docked_strip_->ResizePanelWindow(panel, new_size);
+ // See the comment in OnWindowAutoResized()
+ if (panel->panel_strip() == overflow_strip_.get())
+ docked_strip_->ResizePanelWindow(panel, new_size);
+ else
+ panel->panel_strip()->ResizePanelWindow(panel, new_size);
panel->SetAutoResizable(false);
}
« no previous file with comments | « chrome/browser/ui/panels/panel.cc ('k') | chrome/browser/ui/panels/panel_overflow_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698