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

Unified Diff: chrome/browser/tab_contents/tab_contents_view_mac.mm

Issue 8587001: Have ExtensionHost use TabContents instead of RenderViewHost. Try #3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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/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

Powered by Google App Engine
This is Rietveld 408576698