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

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: Fix nits. 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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/browser_window_controller_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..0dc17f12ddebb38ae54e8f6ae38219fbc257c557 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) {
+ CGFloat minWindowHeight = [window minSize].height;
+ if (windowFrame.size.height + deltaH < minWindowHeight) {
+ // |deltaH| + |windowFrame.size.height| = |minWindowHeight|.
+ deltaH = minWindowHeight - 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))
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/browser_window_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698