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

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: ensureContentsVisibleInSuperview 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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..3801260fb778328118e3e4ce4484f882f213eabc 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 -ensureContentsVisibleInSuperview:(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)ensureContentsVisibleInSuperview:(NSView*)superview;
// Called after we enter fullscreen to ensure that the fullscreen widget will
// have the right frame.
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698