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

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

Issue 155099: Don't install the RWHVMac into the view hierarchy until everything has been p... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 5 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/browser/cocoa/tab_contents_controller.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/tab_strip_controller.mm
===================================================================
--- chrome/browser/cocoa/tab_strip_controller.mm (revision 19942)
+++ chrome/browser/cocoa/tab_strip_controller.mm (working copy)
@@ -78,10 +78,15 @@
- (void)swapInTabAtIndex:(NSInteger)index {
TabContentsController* controller = [tabContentsArray_ objectAtIndex:index];
- // Resize the new view to fit the window
+ // Resize the new view to fit the window. Calling |view| may lazily
+ // instantiate the TabContentsController from the nib. Until we call
+ // |-ensureContentsVisible|, the controller doesn't install the RWHVMac into
+ // the view hierarchy. This is in order to avoid sending the renderer a
+ // spurrious default size loaded from the nib during the call to |-view|.
Mark Mentovai 2009/07/06 19:30:05 spurious
NSView* newView = [controller view];
NSRect frame = [switchView_ bounds];
[newView setFrame:frame];
+ [controller ensureContentsVisible];
// Remove the old view from the view hierarchy. We know there's only one
// child of |switchView_| because we're the one who put it there. There
« no previous file with comments | « chrome/browser/cocoa/tab_contents_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698