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

Unified Diff: chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.h

Issue 2138213003: Mac: Do layout before adding the WebContents to the view hierarchy when switching tabs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: selfnits Created 4 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
Index: chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.h
diff --git a/chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.h b/chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.h
index d729f79bc3a849c21a8e8cf8a26aee23bb6f5a63..f55fe20f8785f120f319c5f246f396a4f5622b7b 100644
--- a/chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.h
+++ b/chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.h
@@ -20,10 +20,9 @@ class WebContents;
// display of the WebContents view.
//
// Client code that inserts [controller view] into the view hierarchy needs to
-// beforehand call the |-ensureContentsSizeDoesNotChange| method. This will
-// avoid multiple resize messages being sent to the renderer and triggering
-// redundant and costly layouts. After the view has been inserted, client code
-// calls |-ensureContentsVisible| to display the WebContents view.
+// call -addContentsToView:(NSView*)superview to match the container to the
+// [superview bounds] and avoid multiple resize messages being sent to the
+// renderer, which triggers redundant and costly layouts.
//
// AutoEmbedFullscreen mode: When enabled, TabContentsController will observe
// for WebContents fullscreen changes and automatically swap the normal
@@ -57,15 +56,10 @@ class WebContents;
// Create the contents of a tab represented by |contents|.
- (id)initWithContents:(content::WebContents*)contents isPopup:(BOOL)popup;
-// Call when the container view owned by TabContentsController is about to be
-// resized and inserted into the view hierarchy, so as to not trigger
-// unnecessary content re-layout.
-- (void)ensureContentsSizeDoesNotChange;
-
-// Call after the container view is inserted into the view hierarchy and
-// properly sized. Then, this method will select either the WebContents view or
-// the fullscreen view and swap it into the view hierarchy for display.
-- (void)ensureContentsVisible;
+// Call to insert the container view into the view hierarchy, sizing it to match
+// |superview|. Then, this method will select either the WebContents view or
+// the fullscreen view and swap it into the container for display.
+- (void)addContentsToView:(NSView*)superview;
// Called after we enter fullscreen to ensure that the fullscreen widget will
// have the right frame.

Powered by Google App Engine
This is Rietveld 408576698