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

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

Issue 10066032: Enable user resizing for docked Panels (GTK and Mac). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix tests 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
« no previous file with comments | « chrome/browser/ui/panels/panel_constants.h ('k') | chrome/browser/ui/panels/panel_overflow_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 07dd99997b5e67f42e5269fba514d0b69cae186a..d7e2260fb5bbad400fe654284008384e5dd4c8d0 100644
--- a/chrome/browser/ui/panels/panel_manager.cc
+++ b/chrome/browser/ui/panels/panel_manager.cc
@@ -187,7 +187,7 @@ void PanelManager::EndDragging(bool cancelled) {
void PanelManager::StartResizingByMouse(Panel* panel,
const gfx::Point& mouse_location,
panel::ResizingSides sides) {
- if (panel->panel_strip() && panel->panel_strip()->CanResizePanel(panel) &&
+ if (panel->CanResizeByMouse() != panel::NOT_RESIZABLE &&
sides != panel::RESIZE_NONE)
resize_controller_->StartResizing(panel, mouse_location, sides);
}
@@ -198,8 +198,11 @@ void PanelManager::ResizeByMouse(const gfx::Point& mouse_location) {
}
void PanelManager::EndResizingByMouse(bool cancelled) {
- if (resize_controller_->IsResizing())
- resize_controller_->EndResizing(cancelled);
+ if (resize_controller_->IsResizing()) {
+ Panel* resized_panel = resize_controller_->EndResizing(cancelled);
+ if (!cancelled && resized_panel->panel_strip())
+ resized_panel->panel_strip()->RefreshLayout();
+ }
}
void PanelManager::OnPanelExpansionStateChanged(Panel* panel) {
@@ -239,9 +242,9 @@ void PanelManager::ResizePanel(Panel* panel, const gfx::Size& new_size) {
void PanelManager::OnPanelResizedByMouse(Panel* panel,
const gfx::Rect& new_bounds) {
+ panel->set_restored_size(new_bounds.size());
panel->panel_strip()->OnPanelResizedByMouse(panel, new_bounds);
panel->SetAutoResizable(false);
-
}
void PanelManager::MovePanelToStrip(
« no previous file with comments | « chrome/browser/ui/panels/panel_constants.h ('k') | chrome/browser/ui/panels/panel_overflow_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698