Index: chrome/browser/tab_contents/tab_contents_view_mac.mm |
diff --git a/chrome/browser/tab_contents/tab_contents_view_mac.mm b/chrome/browser/tab_contents/tab_contents_view_mac.mm |
index 3c610090ce07e8f37bfc476a10ffe4672a6aa14b..9d64d358952f38aa84b3dfa1f9e9a2119df36791 100644 |
--- a/chrome/browser/tab_contents/tab_contents_view_mac.mm |
+++ b/chrome/browser/tab_contents/tab_contents_view_mac.mm |
@@ -56,6 +56,9 @@ COMPILE_ASSERT_MATCHING_ENUM(DragOperationEvery); |
- (void)clearTabContentsView; |
- (void)closeTabAfterEvent; |
- (void)viewDidBecomeFirstResponder:(NSNotification*)notification; |
+// Notify the RenderWidgetHost that the frame was updated so it can resize |
+// its contents. |
+- (void)renderWidgetHostWasResized; |
@end |
namespace tab_contents_view_mac { |
@@ -82,7 +85,6 @@ TabContentsViewMac::~TabContentsViewMac() { |
void TabContentsViewMac::CreateView(const gfx::Size& initial_size) { |
TabContentsViewCocoa* view = |
[[TabContentsViewCocoa alloc] initWithTabContentsViewMac:this]; |
- [view setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)]; |
cocoa_view_.reset(view); |
} |
@@ -508,6 +510,19 @@ void TabContentsViewMac::CloseTab() { |
[dragSource_ startDrag]; |
} |
+- (void)setFrameWithDeferredUpdate:(NSRect)frameRect { |
+ [super setFrame:frameRect]; |
+ [self performSelector:@selector(renderWidgetHostWasResized) |
+ withObject:nil |
+ afterDelay:0]; |
+} |
+ |
+- (void)renderWidgetHostWasResized { |
+ TabContents* tabContents = [self tabContents]; |
+ if (tabContents->render_view_host()) |
+ tabContents->render_view_host()->WasResized(); |
+} |
+ |
// NSDraggingSource methods |
// Returns what kind of drag operations are available. This is a required |