X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fchrome%2Fbrowser%2Fui%2Fcocoa%2Fversion_independent_window.h;h=afa4e486a5c0d4d437c8faeea774bdc21a7126cf;hb=1afa4dd80ef85af7c90efaea6959db1d92330844;hp=24acce17741f75d1f7d763cb4001797dbe09ffb8;hpb=90762837333c13ccf56f2ad88e4481fc71e8d281;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/chrome/browser/ui/cocoa/version_independent_window.h b/src/chrome/browser/ui/cocoa/version_independent_window.h index 24acce1..afa4e48 100644 --- a/src/chrome/browser/ui/cocoa/version_independent_window.h +++ b/src/chrome/browser/ui/cocoa/version_independent_window.h @@ -19,35 +19,25 @@ @end -// In OSX 10.10, adding subviews to the root view for the NSView hierarchy -// produces warnings. To eliminate the warnings, we resize the contentView to -// fill the window, and add subviews to that. When this class is used on OSX -// 10.9 and lower, subviews are added directly to the root view, and the -// contentView is not resized. -// http://crbug.com/380412 +// By default, the contentView does not occupy the full size of a framed +// window. Chrome still wants to draw in the title bar. Historically, Chrome +// has done this by adding subviews directly to the root view. This causes +// several problems. The most egregious is related to layer ordering when the +// root view does not have a layer. By giving the contentView the same size as +// the window, there is no longer any need to add subviews to the root view. // -// For code to be 10.9 and 10.10 compatible, views should be added to [window -// cr_windowView] instead of [[window contentView] superview]. +// No views should be manually added to [[window contentView] superview]. +// Instead, they should be added to [window cr_windowView]. // // If the window does not have a titlebar, then its contentView already has the // same size as the window. In this case, this class has no effect. // // This class currently does not support changing the window's style after the // window has been initialized. -// -// Since the contentView's size varies between OSes, several NSWindow methods -// are no longer well defined. -// - setContentSize: -// - setContentMinSize: -// - setContentMaxSize: -// - setContentAspectRatio: -// The implementation of this class on OSX 10.10 uses a hacked subclass of -// NSView. It currently does not support the above 4 methods. @interface VersionIndependentWindow : ChromeEventProcessingWindow { @private - // Holds the view that replaces [window contentView]. This view's size is the - // same as the window's size. - // Empty on 10.9 and lower, or if there is no titlebar. + // Holds the view that replaces [window contentView]. This view has the same + // size as the window. Empty if there is no titlebar. base::scoped_nsobject chromeWindowView_; } @@ -55,7 +45,8 @@ - (instancetype)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)windowStyle backing:(NSBackingStoreType)bufferingType - defer:(BOOL)deferCreation; + defer:(BOOL)deferCreation + wantsViewsOverTitlebar:(BOOL)wantsViewsOverTitlebar; @end