| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/panels/docked_panel_strip.h" | 5 #include "chrome/browser/ui/panels/docked_panel_strip.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 } else { | 466 } else { |
| 467 // Maybe bring down the titlebar now that panel is not drawing attention. | 467 // Maybe bring down the titlebar now that panel is not drawing attention. |
| 468 if (panel->expansion_state() == Panel::TITLE_ONLY && !are_titlebars_up_) | 468 if (panel->expansion_state() == Panel::TITLE_ONLY && !are_titlebars_up_) |
| 469 panel->SetExpansionState(Panel::MINIMIZED); | 469 panel->SetExpansionState(Panel::MINIMIZED); |
| 470 } | 470 } |
| 471 } | 471 } |
| 472 | 472 |
| 473 void DockedPanelStrip::OnPanelTitlebarClicked(Panel* panel, | 473 void DockedPanelStrip::OnPanelTitlebarClicked(Panel* panel, |
| 474 panel::ClickModifier modifier) { | 474 panel::ClickModifier modifier) { |
| 475 DCHECK_EQ(this, panel->panel_strip()); | 475 DCHECK_EQ(this, panel->panel_strip()); |
| 476 if (!IsPanelMinimized(panel)) |
| 477 return; |
| 478 |
| 476 if (modifier == panel::APPLY_TO_ALL) | 479 if (modifier == panel::APPLY_TO_ALL) |
| 477 ToggleMinimizeAll(panel); | 480 ToggleMinimizeAll(panel); |
| 478 | 481 else |
| 479 // TODO(jennb): Move all other titlebar click handling here. | 482 RestorePanel(panel); |
| 480 // (http://crbug.com/118431) | |
| 481 } | 483 } |
| 482 | 484 |
| 483 void DockedPanelStrip::ActivatePanel(Panel* panel) { | 485 void DockedPanelStrip::ActivatePanel(Panel* panel) { |
| 484 DCHECK_EQ(this, panel->panel_strip()); | 486 DCHECK_EQ(this, panel->panel_strip()); |
| 485 | 487 |
| 486 // Make sure the panel is expanded when activated so the user input | 488 // Make sure the panel is expanded when activated so the user input |
| 487 // does not go into a collapsed window. | 489 // does not go into a collapsed window. |
| 488 panel->SetExpansionState(Panel::EXPANDED); | 490 panel->SetExpansionState(Panel::EXPANDED); |
| 489 | 491 |
| 490 // If the layout needs to be refreshed, it will happen in response to | 492 // If the layout needs to be refreshed, it will happen in response to |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 875 // focus and another gains it. | 877 // focus and another gains it. |
| 876 refresh_action_factory_.InvalidateWeakPtrs(); | 878 refresh_action_factory_.InvalidateWeakPtrs(); |
| 877 MessageLoop::current()->PostDelayedTask( | 879 MessageLoop::current()->PostDelayedTask( |
| 878 FROM_HERE, | 880 FROM_HERE, |
| 879 base::Bind(&DockedPanelStrip::RefreshLayout, | 881 base::Bind(&DockedPanelStrip::RefreshLayout, |
| 880 refresh_action_factory_.GetWeakPtr()), | 882 refresh_action_factory_.GetWeakPtr()), |
| 881 base::TimeDelta::FromMilliseconds(PanelManager::AdjustTimeInterval( | 883 base::TimeDelta::FromMilliseconds(PanelManager::AdjustTimeInterval( |
| 882 kRefreshLayoutAfterActivePanelChangeDelayMs))); | 884 kRefreshLayoutAfterActivePanelChangeDelayMs))); |
| 883 } | 885 } |
| 884 | 886 |
| OLD | NEW |