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

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

Issue 1971283003: Temporary fix for "white patch" fullscreen regression on OSX (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 7 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.mm
diff --git a/chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.mm b/chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.mm
index 08c4324e78d06e5ab0b102311cdad54fa9967e91..0c4c4f1b533024c458415ca102c913584e5ed4a0 100644
--- a/chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.mm
+++ b/chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.mm
@@ -77,6 +77,10 @@ class FullscreenObserver : public WebContentsObserver {
// Returns YES if the content view should be resized.
- (BOOL)shouldResizeContentView;
+
+// Returns YES if the content view is inside a popup.
+- (BOOL)isPopup;
+
@end
// An NSView with special-case handling for when the contents view does not
@@ -112,11 +116,16 @@ class FullscreenObserver : public WebContentsObserver {
// Override auto-resizing logic to query the delegate for the exact frame to
// use for the contents view.
+// TODO(spqchan): The popup check is a temporary solution to fix the regression
+// issue described in crbug.com/604288. This method doesn't really affect
+// fullscreen if the content is inside a normal browser window, but would
+// cause a flash fullscreen widget to blow up if it's inside a popup.
- (void)resizeSubviewsWithOldSize:(NSSize)oldBoundsSize {
NSView* const contentsView =
[[self subviews] count] > 0 ? [[self subviews] objectAtIndex:0] : nil;
if (!contentsView || [contentsView autoresizingMask] == NSViewNotSizable ||
- !delegate_ || ![delegate_ shouldResizeContentView]) {
+ !delegate_ ||
+ (![delegate_ shouldResizeContentView] && [delegate_ isPopup])) {
return;
}
@@ -184,10 +193,11 @@ class FullscreenObserver : public WebContentsObserver {
@synthesize webContents = contents_;
@synthesize blockFullscreenResize = blockFullscreenResize_;
-- (id)initWithContents:(WebContents*)contents {
+- (id)initWithContents:(WebContents*)contents isPopup:(BOOL)popup {
if ((self = [super initWithNibName:nil bundle:nil])) {
fullscreenObserver_.reset(new FullscreenObserver(self));
[self changeWebContents:contents];
+ isPopup_ = popup;
}
return self;
}
@@ -387,4 +397,8 @@ class FullscreenObserver : public WebContentsObserver {
return !isEmbeddingFullscreenWidget_ || !blockFullscreenResize_;
}
+- (BOOL)isPopup {
+ return isPopup_;
+}
+
@end
« no previous file with comments | « chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.h ('k') | chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698