| Index: chrome/browser/ui/panels/panel_resize_controller.cc
|
| diff --git a/chrome/browser/ui/panels/panel_resize_controller.cc b/chrome/browser/ui/panels/panel_resize_controller.cc
|
| index 16e56e2682956b74d6e81369cf6d1750efda270d..939d296df1a48e4921d59ad99f572d28281418c5 100644
|
| --- a/chrome/browser/ui/panels/panel_resize_controller.cc
|
| +++ b/chrome/browser/ui/panels/panel_resize_controller.cc
|
| @@ -5,8 +5,6 @@
|
| #include "chrome/browser/ui/panels/panel_resize_controller.h"
|
|
|
| #include "base/logging.h"
|
| -#include "chrome/browser/ui/panels/detached_panel_strip.h"
|
| -#include "chrome/browser/ui/panels/docked_panel_strip.h"
|
| #include "chrome/browser/ui/panels/panel.h"
|
| #include "chrome/browser/ui/panels/panel_manager.h"
|
| #include "chrome/browser/ui/panels/panel_strip.h"
|
| @@ -47,21 +45,19 @@ void PanelResizeController::StartResizing(Panel* panel,
|
| const gfx::Point& mouse_location,
|
| panel::ResizingSides sides) {
|
| DCHECK(!IsResizing());
|
| - DCHECK(panel->panel_strip() &&
|
| - panel->panel_strip()->CanResizePanel(panel));
|
| -
|
| + DCHECK_NE(panel::NOT_RESIZABLE, panel->CanResizeByMouse());
|
| DCHECK_NE(panel::RESIZE_NONE, sides);
|
|
|
| mouse_location_at_start_ = mouse_location;
|
| bounds_at_start_ = panel->GetBounds();
|
| sides_resized_ = sides;
|
| resizing_panel_ = panel;
|
| + resizing_panel_->SetPreviewMode(true);
|
| }
|
|
|
| void PanelResizeController::Resize(const gfx::Point& mouse_location) {
|
| DCHECK(IsResizing());
|
| - if (resizing_panel_->panel_strip() == NULL ||
|
| - !resizing_panel_->panel_strip()->CanResizePanel(resizing_panel_)) {
|
| + if (resizing_panel_->CanResizeByMouse() == panel::NOT_RESIZABLE) {
|
| EndResizing(false);
|
| return;
|
| }
|
| @@ -72,6 +68,7 @@ void PanelResizeController::Resize(const gfx::Point& mouse_location) {
|
| mouse_location.x() - mouse_location_at_start_.x(), 0));
|
| }
|
| if (ResizingBottom(sides_resized_)) {
|
| + DCHECK_EQ(panel::ALL_SIDES, resizing_panel_->CanResizeByMouse());
|
| bounds.set_height(std::max(bounds_at_start_.height() +
|
| mouse_location.y() - mouse_location_at_start_.y(), 0));
|
| }
|
| @@ -111,6 +108,10 @@ void PanelResizeController::EndResizing(bool cancelled) {
|
| bounds_at_start_);
|
| }
|
|
|
| + resizing_panel_->SetPreviewMode(false);
|
| + if (resizing_panel_->panel_strip())
|
| + resizing_panel_->panel_strip()->RefreshLayout();
|
| +
|
| // Do a thorough cleanup.
|
| resizing_panel_ = NULL;
|
| sides_resized_ = panel::RESIZE_NONE;
|
|
|