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

Unified Diff: chrome/browser/ui/cocoa/browser_window_controller.mm

Issue 1052123006: Prevent bookmarks bar toggling from decreasing window height to 0. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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/cocoa/browser_window_controller.mm
diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm
index f349fbb93ce698c980bd96a6ada90c07f1bbde95..e145477d3cc3d4921a7bc1475dc022123af4d3c2 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller.mm
@@ -838,6 +838,19 @@ using content::WebContents;
NSRect windowFrame = [window frame];
NSRect workarea = [[window screen] visibleFrame];
+ // Prevent the window from growing smaller than its minimum height:
+ // http://crbug.com/230400 .
+ if (deltaH < 0) {
+ NSSize minWindowSize = [window minSize];
Avi (use Gerrit) 2015/04/15 04:27:26 Might as well do CGFloat minWindowHeight = [windo
shrike 2015/04/15 17:01:33 Agreed.
+ if (windowFrame.size.height + deltaH < minWindowSize.height) {
+ // |deltaH| + |windowFrame.size.height| = |minWindowSize.height|.
+ deltaH = minWindowSize.height - windowFrame.size.height;
+ }
+ if (deltaH == 0) {
+ return NO;
+ }
+ }
+
// If the window is not already fully in the workarea, do not adjust its frame
// at all.
if (!NSContainsRect(workarea, windowFrame))

Powered by Google App Engine
This is Rietveld 408576698