| 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 c918b8a0d9c510fdc0e6ec7146f1df72df4e3fa5..b8db2361b73cf22edbfbeb8a24041b38e8086906 100644
|
| --- a/chrome/browser/ui/panels/panel_manager.cc
|
| +++ b/chrome/browser/ui/panels/panel_manager.cc
|
| @@ -117,7 +117,7 @@ Panel* PanelManager::CreatePanel(Browser* browser) {
|
| int width = browser->override_bounds().width();
|
| int height = browser->override_bounds().height();
|
| Panel* panel = new Panel(browser, gfx::Size(width, height));
|
| - panel->MoveToStrip(docked_strip_.get());
|
| + docked_strip_->AddPanel(panel);
|
|
|
| content::NotificationService::current()->Notify(
|
| chrome::NOTIFICATION_PANEL_ADDED,
|
| @@ -147,10 +147,11 @@ void PanelManager::CheckFullScreenMode() {
|
| }
|
|
|
| void PanelManager::OnPanelClosed(Panel* panel) {
|
| - if (num_panels() == 0)
|
| + if (num_panels() == 1)
|
| full_screen_mode_timer_.Stop();
|
|
|
| drag_controller_->OnPanelClosed(panel);
|
| + panel->panel_strip()->RemovePanel(panel);
|
|
|
| content::NotificationService::current()->Notify(
|
| chrome::NOTIFICATION_PANEL_CLOSED,
|
| @@ -192,6 +193,33 @@ void PanelManager::ResizePanel(Panel* panel, const gfx::Size& new_size) {
|
| docked_strip_->ResizePanelWindow(panel, new_size);
|
| }
|
|
|
| +void PanelManager::ChangePanelLayout(Panel* panel,
|
| + PanelStrip::Type new_layout) {
|
| + PanelStrip* current_strip = panel->panel_strip();
|
| + DCHECK(current_strip);
|
| + DCHECK_NE(current_strip->type(), new_layout);
|
| + current_strip->RemovePanel(panel);
|
| +
|
| + switch (new_layout) {
|
| + case PanelStrip::DETACHED:
|
| + detached_strip_->AddPanel(panel);
|
| + break;
|
| + case PanelStrip::DOCKED:
|
| + docked_strip_->AddPanel(panel);
|
| + break;
|
| + case PanelStrip::IN_OVERFLOW:
|
| + overflow_strip_->AddPanel(panel);
|
| + break;
|
| + default:
|
| + NOTREACHED();
|
| + }
|
| +
|
| + content::NotificationService::current()->Notify(
|
| + chrome::NOTIFICATION_PANEL_CHANGED_LAYOUT_MODE,
|
| + content::Source<Panel>(panel),
|
| + content::NotificationService::NoDetails());
|
| +}
|
| +
|
| bool PanelManager::ShouldBringUpTitlebars(int mouse_x, int mouse_y) const {
|
| return docked_strip_->ShouldBringUpTitlebars(mouse_x, mouse_y);
|
| }
|
|
|