Commit e07d850d authored by jer.noble@apple.com's avatar jer.noble@apple.com

Refactor creation of the full screen window into an (overridable) method.

https://bugs.webkit.org/show_bug.cgi?id=110369

Reviewed by Eric Carlson.

Add a new WKView method -(NSWindow)createFullScreenWindow which can be overridden
by subclasses to provide custom full screen windows to the WKFullScreenWindowController.

* UIProcess/API/mac/WKView.mm:
(-[WKView fullScreenWindowController]):
(-[WKView createFullScreenWindow]):
* UIProcess/API/mac/WKViewPrivate.h:
* UIProcess/mac/WKFullScreenWindowController.mm:
(-[WKFullScreenWindowController initWithWindow:]):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148901 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent c15b1e79
2013-04-15 Jer Noble <jer.noble@apple.com>
Refactor creation of the full screen window into an (overridable) method.
https://bugs.webkit.org/show_bug.cgi?id=110369
Reviewed by Eric Carlson.
Add a new WKView method -(NSWindow)createFullScreenWindow which can be overridden
by subclasses to provide custom full screen windows to the WKFullScreenWindowController.
* UIProcess/API/mac/WKView.mm:
(-[WKView fullScreenWindowController]):
(-[WKView createFullScreenWindow]):
* UIProcess/API/mac/WKViewPrivate.h:
* UIProcess/mac/WKFullScreenWindowController.mm:
(-[WKFullScreenWindowController initWithWindow:]):
2013-04-22 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Add webkit_web_context_set_disk_cache_directory to WebKit2 GTK+ API
......@@ -83,6 +83,7 @@
#import <WebCore/TextAlternativeWithRange.h>
#import <WebCore/WebCoreNSStringExtras.h>
#import <WebCore/WebCoreFullScreenPlaceholderView.h>
#import <WebCore/WebCoreFullScreenWindow.h>
#import <WebCore/FileSystem.h>
#import <WebKitSystemInterface.h>
#import <sys/stat.h>
......@@ -3064,7 +3065,7 @@ static NSString *pathWithUniqueFilenameForPath(NSString *path)
- (WKFullScreenWindowController*)fullScreenWindowController
{
if (!_data->_fullScreenWindowController) {
_data->_fullScreenWindowController.adoptNS([[WKFullScreenWindowController alloc] init]);
_data->_fullScreenWindowController.adoptNS([[WKFullScreenWindowController alloc] initWithWindow:[self createFullScreenWindow]]);
[_data->_fullScreenWindowController.get() setWebView:self];
}
return _data->_fullScreenWindowController.get();
......@@ -3490,6 +3491,15 @@ static NSString *pathWithUniqueFilenameForPath(NSString *path)
}
}
- (NSWindow*)createFullScreenWindow
{
#if ENABLE(FULLSCREEN_API)
return [[[WebCoreFullScreenWindow alloc] initWithContentRect:NSZeroRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO] autorelease];
#else
return nil;
#endif
}
@end
@implementation WKResponderChainSink
......
......@@ -64,6 +64,7 @@ typedef enum {
@property(copy, nonatomic) NSColor *underlayColor;
- (NSView*)fullScreenPlaceholderView;
- (NSWindow*)createFullScreenWindow;
- (void)beginDeferringViewInWindowChanges;
- (void)endDeferringViewInWindowChanges;
......
......@@ -90,14 +90,13 @@ static NSRect convertRectToScreen(NSWindow *window, NSRect rect)
#pragma mark -
#pragma mark Initialization
- (id)init
- (id)initWithWindow:(NSWindow *)window
{
RetainPtr<NSWindow> window = adoptNS([[WebCoreFullScreenWindow alloc] initWithContentRect:NSZeroRect styleMask:NSClosableWindowMask backing:NSBackingStoreBuffered defer:NO]);
self = [super initWithWindow:window.get()];
self = [super initWithWindow:window];
if (!self)
return nil;
[window.get() setDelegate:self];
[window.get() setCollectionBehavior:([window collectionBehavior] | NSWindowCollectionBehaviorFullScreenPrimary)];
[window setDelegate:self];
[window setCollectionBehavior:([window collectionBehavior] | NSWindowCollectionBehaviorFullScreenPrimary)];
[self windowDidLoad];
return self;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment