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

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

Issue 149094: Removes our homespun grow box and replaces it with the... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 6 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/app/nibs/en.lproj/TabContents.xib ('k') | chrome/browser/cocoa/tab_contents_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/browser_window_controller.mm
===================================================================
--- chrome/browser/cocoa/browser_window_controller.mm (revision 19396)
+++ chrome/browser/cocoa/browser_window_controller.mm (working copy)
@@ -36,6 +36,20 @@
}
+@interface NSWindow (NSPrivateApis)
+// Note: These functions are private, use -[NSObject respondsToSelector:]
+// before calling them.
+
+- (void)setAutorecalculatesContentBorderThickness:(BOOL)b
+ forEdge:(NSRectEdge)e;
+- (void)setContentBorderThickness:(CGFloat)b forEdge:(NSRectEdge)e;
+
+- (void)setBottomCornerRounded:(BOOL)rounded;
+
+- (NSRect)_growBoxRect;
+@end
+
+
@interface BrowserWindowController(Private)
- (void)positionToolbar;
@@ -95,6 +109,11 @@
// Retain it per the comment in the header.
window_.reset([[self window] retain]);
+ // Sets the window to not have rounded corners, which prevents
+ // the resize control from being inset slightly and looking ugly.
+ if ([window_ respondsToSelector:@selector(setBottomCornerRounded:)])
+ [window_ setBottomCornerRounded:NO];
+
// Since we don't have a standard resize control, Cocoa won't enable the
// zoom (green) button on the titlebar for us. Grab it and enable it
// manually. Note that when launched from XCode, the doesn't work for the
@@ -384,7 +403,17 @@
// in the coordinate system of the content area of the currently selected tab.
// |windowGrowBox| needs to be in the window's coordinate system.
- (NSRect)selectedTabGrowBoxRect {
- return [tabStripController_ selectedTabGrowBoxRect];
+ if (![window_ respondsToSelector:@selector(_growBoxRect)])
+ return NSZeroRect;
+
+ // Before we return a rect, we need to convert it from window coordinates
+ // to tab content area coordinates and flip the coordinate system.
+ NSRect growBoxRect =
+ [[self tabContentArea] convertRect:[window_ _growBoxRect] fromView:nil];
+ growBoxRect.origin.y =
+ [[self tabContentArea] frame].size.height - growBoxRect.size.height -
+ growBoxRect.origin.y;
+ return growBoxRect;
}
// Accept tabs from a BrowserWindowController with the same Profile.
@@ -630,17 +659,6 @@
@end
-
-@interface NSWindow (NSPrivateApis)
-// Note: These functions are private, use -[NSObject respondsToSelector:]
-// before calling them.
-
-- (void)setAutorecalculatesContentBorderThickness:(BOOL)b
- forEdge:(NSRectEdge)e;
-- (void)setContentBorderThickness:(CGFloat)b forEdge:(NSRectEdge)e;
-@end
-
-
@implementation BrowserWindowController (Private)
// Position |toolbarView_| below the tab strip, but not as a sibling. The
« no previous file with comments | « chrome/app/nibs/en.lproj/TabContents.xib ('k') | chrome/browser/cocoa/tab_contents_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698