diff options
author | pinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-19 18:05:14 +0000 |
---|---|---|
committer | pinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-19 18:05:14 +0000 |
commit | fb63b72ec46cf173aff67fc7c377da1c56a49fce (patch) | |
tree | ef462a15ea4c0f9d23ad31dc670ec745df59e30d /chrome/browser/cocoa/tab_contents_controller.mm | |
parent | 1bd24327fb1ff4461e75e8347e3ed6c672632776 (diff) | |
download | chromium_src-fb63b72ec46cf173aff67fc7c377da1c56a49fce.zip chromium_src-fb63b72ec46cf173aff67fc7c377da1c56a49fce.tar.gz chromium_src-fb63b72ec46cf173aff67fc7c377da1c56a49fce.tar.bz2 |
Hook up the resize rect for Mac and enable its use in the renderer (mac-only).
Review URL: http://codereview.chromium.org/21512
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10019 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/tab_contents_controller.mm')
-rw-r--r-- | chrome/browser/cocoa/tab_contents_controller.mm | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/tab_contents_controller.mm b/chrome/browser/cocoa/tab_contents_controller.mm index 4b8eb8b..5d62716 100644 --- a/chrome/browser/cocoa/tab_contents_controller.mm +++ b/chrome/browser/cocoa/tab_contents_controller.mm @@ -202,6 +202,28 @@ class LocationBarBridge : public LocationBar { [starButton_ setImage:[NSImage imageNamed:starImageName]]; } +// Return the rect, in WebKit coordinates (flipped), of the window's grow box +// in the coordinate system of the content area of this tab. +// |windowGrowBox| needs to be in the window's coordinate system. +- (NSRect)growBoxFromWindowGrowBox:(NSRect)windowGrowBox { + NSRect localGrowBox = NSMakeRect(0, 0, 0, 0); + NSView* contentView = contents_->GetNativeView(); + if (contentView) { + localGrowBox = windowGrowBox; + // The scrollbar assumes that the resizer goes all the way down to the + // bottom corner, so we ignore any y offset to the rect itself and use the + // entire bottom corner. + localGrowBox.origin.y = 0; + // Convert to view coordinates from window coordinates. + localGrowBox = [contentView convertRect:localGrowBox fromView:nil]; + // Flip the rect in view coordinates + localGrowBox.origin.y = + [contentView frame].size.height - localGrowBox.origin.y - + localGrowBox.size.height; + } + return localGrowBox; +} + @end //-------------------------------------------------------------------------- |