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

Side by Side Diff: chrome/browser/ui/panels/panel.cc

Issue 10260001: Remove panel size limit when user resizes it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch for landing Created 8 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/panel.h" 5 #include "chrome/browser/ui/panels/panel.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "chrome/browser/ui/panels/docked_panel_strip.h" 9 #include "chrome/browser/ui/panels/docked_panel_strip.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 return; 129 return;
130 130
131 DCHECK(min_size.width() <= max_size.width()); 131 DCHECK(min_size.width() <= max_size.width());
132 DCHECK(min_size.height() <= max_size.height()); 132 DCHECK(min_size.height() <= max_size.height());
133 min_size_ = min_size; 133 min_size_ = min_size;
134 max_size_ = max_size; 134 max_size_ = max_size;
135 135
136 ConfigureAutoResize(browser()->GetSelectedWebContents()); 136 ConfigureAutoResize(browser()->GetSelectedWebContents());
137 } 137 }
138 138
139 void Panel::ClampSize(gfx::Size* size) const { 139 gfx::Size Panel::ClampSize(const gfx::Size& size) const {
140 140
141 // The panel width: 141 // The panel width:
142 // * cannot grow or shrink to go beyond [min_width, max_width] 142 // * cannot grow or shrink to go beyond [min_width, max_width]
143 int new_width = size->width(); 143 int new_width = size.width();
144 if (new_width > max_size_.width()) 144 if (new_width > max_size_.width())
145 new_width = max_size_.width(); 145 new_width = max_size_.width();
146 if (new_width < min_size_.width()) 146 if (new_width < min_size_.width())
147 new_width = min_size_.width(); 147 new_width = min_size_.width();
148 148
149 // The panel height: 149 // The panel height:
150 // * cannot grow or shrink to go beyond [min_height, max_height] 150 // * cannot grow or shrink to go beyond [min_height, max_height]
151 int new_height = size->height(); 151 int new_height = size.height();
152 if (new_height > max_size_.height()) 152 if (new_height > max_size_.height())
153 new_height = max_size_.height(); 153 new_height = max_size_.height();
154 if (new_height < min_size_.height()) 154 if (new_height < min_size_.height())
155 new_height = min_size_.height(); 155 new_height = min_size_.height();
156 156
157 size->SetSize(new_width, new_height); 157 return gfx::Size(new_width, new_height);
158 } 158 }
159 159
160 160
161 void Panel::SetAppIconVisibility(bool visible) { 161 void Panel::SetAppIconVisibility(bool visible) {
162 native_panel_->SetPanelAppIconVisibility(visible); 162 native_panel_->SetPanelAppIconVisibility(visible);
163 } 163 }
164 164
165 void Panel::SetAlwaysOnTop(bool on_top) { 165 void Panel::SetAlwaysOnTop(bool on_top) {
166 if (always_on_top_ == on_top) 166 if (always_on_top_ == on_top)
167 return; 167 return;
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 763
764 if (modifier == panel::APPLY_TO_ALL) 764 if (modifier == panel::APPLY_TO_ALL)
765 panel_strip_->RestoreAll(); 765 panel_strip_->RestoreAll();
766 else 766 else
767 Restore(); 767 Restore();
768 } 768 }
769 769
770 void Panel::DestroyBrowser() { 770 void Panel::DestroyBrowser() {
771 native_panel_->DestroyPanelBrowser(); 771 native_panel_->DestroyPanelBrowser();
772 } 772 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/panels/panel.h ('k') | chrome/browser/ui/panels/panel_browser_view_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698