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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 | 427 |
428 // Calls RefreshLayout to update the dragging panel to its final position | 428 // Calls RefreshLayout to update the dragging panel to its final position |
429 // when the drag ends normally. Otherwise, the drag within this strip is | 429 // when the drag ends normally. Otherwise, the drag within this strip is |
430 // aborted because either the drag enters other strip or the drag is | 430 // aborted because either the drag enters other strip or the drag is |
431 // cancelled. Either way, we don't need to do anything here and let the drag | 431 // cancelled. Either way, we don't need to do anything here and let the drag |
432 // controller handle the inter-strip transition or the drag cancellation. | 432 // controller handle the inter-strip transition or the drag cancellation. |
433 if (!aborted) | 433 if (!aborted) |
434 RefreshLayout(); | 434 RefreshLayout(); |
435 } | 435 } |
436 | 436 |
437 bool DockedPanelStrip::CanResizePanel(const Panel* panel) const { | 437 panel::Resizability DockedPanelStrip::GetPanelResizability( |
438 return false; | 438 const Panel* panel) const { |
| 439 return (!panel->has_temporary_layout() && |
| 440 panel->expansion_state() == Panel::EXPANDED) ? |
| 441 panel::RESIZABLE_ALL_SIDES_EXCEPT_BOTTOM : panel::NOT_RESIZABLE; |
439 } | 442 } |
440 | 443 |
441 void DockedPanelStrip::OnPanelResizedByMouse(Panel* panel, | 444 void DockedPanelStrip::OnPanelResizedByMouse(Panel* panel, |
442 const gfx::Rect& new_bounds) { | 445 const gfx::Rect& new_bounds) { |
443 DCHECK_EQ(this, panel->panel_strip()); | 446 DCHECK_EQ(this, panel->panel_strip()); |
444 NOTREACHED(); | 447 panel->SetPanelBoundsInstantly(new_bounds); |
445 } | 448 } |
446 | 449 |
447 | 450 |
448 void DockedPanelStrip::OnPanelExpansionStateChanged(Panel* panel) { | 451 void DockedPanelStrip::OnPanelExpansionStateChanged(Panel* panel) { |
449 gfx::Size size = panel->restored_size(); | 452 gfx::Size size = panel->restored_size(); |
450 Panel::ExpansionState expansion_state = panel->expansion_state(); | 453 Panel::ExpansionState expansion_state = panel->expansion_state(); |
451 switch (expansion_state) { | 454 switch (expansion_state) { |
452 case Panel::EXPANDED: | 455 case Panel::EXPANDED: |
453 | 456 |
454 break; | 457 break; |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
879 // Always update limits, even on existing panels, in case the limits changed | 882 // Always update limits, even on existing panels, in case the limits changed |
880 // while panel was out of the strip. | 883 // while panel was out of the strip. |
881 int max_panel_width = GetMaxPanelWidth(); | 884 int max_panel_width = GetMaxPanelWidth(); |
882 int max_panel_height = GetMaxPanelHeight(); | 885 int max_panel_height = GetMaxPanelHeight(); |
883 panel->SetSizeRange(gfx::Size(kPanelMinWidth, kPanelMinHeight), | 886 panel->SetSizeRange(gfx::Size(kPanelMinWidth, kPanelMinHeight), |
884 gfx::Size(max_panel_width, max_panel_height)); | 887 gfx::Size(max_panel_width, max_panel_height)); |
885 | 888 |
886 panel->set_attention_mode(Panel::USE_PANEL_ATTENTION); | 889 panel->set_attention_mode(Panel::USE_PANEL_ATTENTION); |
887 panel->SetAppIconVisibility(true); | 890 panel->SetAppIconVisibility(true); |
888 panel->SetAlwaysOnTop(true); | 891 panel->SetAlwaysOnTop(true); |
889 panel->EnableResizeByMouse(false); | 892 panel->EnableResizeByMouse(true); |
890 } | 893 } |
OLD | NEW |