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

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

Issue 9517010: Change panels to be able to turn off autoresize. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ensure that the latest version is uploaded. Created 8 years, 10 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/docked_panel_strip.cc
diff --git a/chrome/browser/ui/panels/docked_panel_strip.cc b/chrome/browser/ui/panels/docked_panel_strip.cc
index 4b2099a88a8d63025090275775bbf7f3faa1e9f0..ab679d93a65080f3a9895e56c0f9247653ced89a 100644
--- a/chrome/browser/ui/panels/docked_panel_strip.cc
+++ b/chrome/browser/ui/panels/docked_panel_strip.cc
@@ -449,7 +449,11 @@ void DockedPanelStrip::DecrementMinimizedPanels() {
}
void DockedPanelStrip::ResizePanelWindow(
- Panel* panel, const gfx::Size& preferred_window_size) {
+ Panel* panel,
+ const gfx::Size& preferred_window_size,
+ AutoResizeState auto_resize_state) {
+ DCHECK(auto_resize_state == AUTORESIZE_ENABLED ||
+ auto_resize_state == AUTORESIZE_DISABLED);
// The panel width:
// * cannot grow or shrink to go beyond [min_width, max_width]
int new_width = preferred_window_size.width();
@@ -471,6 +475,10 @@ void DockedPanelStrip::ResizePanelWindow(
if (new_size != panel->restored_size())
panel->set_restored_size(new_size);
+ // After the restored size has been set, then set the auto-resize
+ // state as appropriate.
+ panel->SetAutoResizable(auto_resize_state == AUTORESIZE_ENABLED);
+
gfx::Rect bounds = panel->GetBounds();
int delta_x = bounds.width() - new_width;

Powered by Google App Engine
This is Rietveld 408576698