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

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

Issue 10066032: Enable user resizing for docked Panels (GTK and Mac). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: minor cleanup Created 8 years, 8 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
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;

Powered by Google App Engine
This is Rietveld 408576698