Commit c7a89cb8 authored by darin's avatar darin
Browse files

WebCore:

	- fixed 3069264 -- REGRESSION: windows created for links with
	target=blank start out hidden (window menu only)

        * kwq/WebCoreBridge.h: Removed openNewWindowWithURL:referrer:frameName: and
	added createWindowWithURL:referrer:frameName: and showWindow.

        * kwq/KWQKHTMLPartBrowserExtension.mm:
        (KHTMLPartBrowserExtension::createNewWindow): Call createWindowWithURL,
	and then showWindow after the window is set up. Also change the code that
	flips coordinates to always use the height of the first screen instead of
	using the height of the screen the window is on, which sounds right, but
	is wrong.

        * kwq/KWQKHTMLPartImpl.mm:
        (KWQKHTMLPartImpl::bridgeForFrameName): Call createWindowWithURL and then
	showWindow in the case where we create a window.
        (KWQKHTMLPartImpl::urlSelected): Remove unused command-click code. The real
	command-click code is in the browser now.

WebKit:

	WebKit support for creating windows and then showing them later
	after setting them up.

        * WebCoreSupport.subproj/WebBridge.m:
        (-[WebBridge createWindowWithURL:referrer:frameName:]): Replaced the old
	openNewWindowWithURL with this. It calls the new window operations delegate
	method.
        (-[WebBridge showWindow]): Added. Calls the window operations delegate showWindow method.
        (-[WebBridge createChildFrameNamed:withURL:referrer:renderPart:allowsScrolling:marginWidth:marginHeight:]):
	Call _createFrameNamed instead of createFrameNamed.

        * WebView.subproj/WebWindowOperationsDelegate.h: Replaced the openNewWindowWithURL
	method with a new method named createWindowWithURL. Added showWindow and showWindowBehindFrontmost.

        * WebView.subproj/WebControllerPrivate.h: Renamed createFrameNamed to _createFrameNamed
	and removed the data source parameter. Added _openNewWindowWithURL:referrer:behind:
	for the convenience of those who used to call the window operations delegate directly
	to open the window.
        * WebView.subproj/WebControllerPrivate.m:
        (-[WebController _createFrameNamed:inParent:allowsScrolling:]): Renamed, and removed
	the data source parameter.
        (-[WebController _openNewWindowWithURL:referrer:behind:]): Added.

        * Plugins.subproj/WebBaseNetscapePluginView.m:
        (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]):
        * WebView.subproj/WebDefaultContextMenuDelegate.m:
        (-[WebDefaultContextMenuDelegate openNewWindowWithURL:referrer:]):
        * WebView.subproj/WebFrame.m: (-[WebFrame frameNamed:]):
        * WebView.subproj/WebHTMLViewPrivate.m:
        (-[WebHTMLView _continueAfterClickPolicyForEvent:]):
	Use a private WebController method instead of calling the delegate directly,
	because it now takes two method calls to create and display a new window.

        * Misc.subproj/WebNSViewExtras.m:
        * WebCoreSupport.subproj/WebSubresourceClient.m:
        * WebView.subproj/WebController.m:
        * WebView.subproj/WebDataSource.m:
        * WebView.subproj/WebFramePrivate.m:
        * WebView.subproj/WebHTMLView.m:
        * WebView.subproj/WebMainResourceClient.m:
        * WebView.subproj/WebPreferences.m:
        * WebView.subproj/WebView.m:
        * WebView.subproj/WebViewPrivate.m:
	Tweaked comments.

WebBrowser:

	WebBrowser support for creating windows and then showing them later
	after setting them up.

        * BrowserDocumentController.h: Add a new policy, CreateHiddenWindow.
        * BrowserDocumentController.m:
        (-[BrowserDocumentController _goToEachURL:referrer:windowPolicy:]):
	Pass NO for display if policy is CreateHiddenWindow.
        (-[BrowserDocumentController tryMultipleURLs:windowPolicy:]): Ditto.

        * BrowserWebController.m:
        (-[BrowserWebController createWindowWithURL:referrer:]): Added. Like
	the old openNewWindowWithURL method, but uses CreateHiddenWindow.
        (-[BrowserWebController showWindow]): Added. Tells the window controller
	to show the window.
        (-[BrowserWebController showWindowBehindFrontmost]): Added. Tells the
	window controllers to show the window after telling the document that
	the window should open behind the frontmost.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 81af16e8
2002-10-09 Darin Adler <darin@apple.com>
- fixed 3069264 -- REGRESSION: windows created for links with
target=blank start out hidden (window menu only)
* kwq/WebCoreBridge.h: Removed openNewWindowWithURL:referrer:frameName: and
added createWindowWithURL:referrer:frameName: and showWindow.
* kwq/KWQKHTMLPartBrowserExtension.mm:
(KHTMLPartBrowserExtension::createNewWindow): Call createWindowWithURL,
and then showWindow after the window is set up. Also change the code that
flips coordinates to always use the height of the first screen instead of
using the height of the screen the window is on, which sounds right, but
is wrong.
* kwq/KWQKHTMLPartImpl.mm:
(KWQKHTMLPartImpl::bridgeForFrameName): Call createWindowWithURL and then
showWindow in the case where we create a window.
(KWQKHTMLPartImpl::urlSelected): Remove unused command-click code. The real
command-click code is in the browser now.
2002-10-09 Darin Adler <darin@apple.com>
 
- fixed 3069749 -- crash in QString during third run of cvs-base
......
2002-10-09 Darin Adler <darin@apple.com>
- fixed 3069264 -- REGRESSION: windows created for links with
target=blank start out hidden (window menu only)
* kwq/WebCoreBridge.h: Removed openNewWindowWithURL:referrer:frameName: and
added createWindowWithURL:referrer:frameName: and showWindow.
* kwq/KWQKHTMLPartBrowserExtension.mm:
(KHTMLPartBrowserExtension::createNewWindow): Call createWindowWithURL,
and then showWindow after the window is set up. Also change the code that
flips coordinates to always use the height of the first screen instead of
using the height of the screen the window is on, which sounds right, but
is wrong.
* kwq/KWQKHTMLPartImpl.mm:
(KWQKHTMLPartImpl::bridgeForFrameName): Call createWindowWithURL and then
showWindow in the case where we create a window.
(KWQKHTMLPartImpl::urlSelected): Remove unused command-click code. The real
command-click code is in the browser now.
2002-10-09 Darin Adler <darin@apple.com>
 
- fixed 3069749 -- crash in QString during third run of cvs-base
......
2002-10-09 Darin Adler <darin@apple.com>
- fixed 3069264 -- REGRESSION: windows created for links with
target=blank start out hidden (window menu only)
* kwq/WebCoreBridge.h: Removed openNewWindowWithURL:referrer:frameName: and
added createWindowWithURL:referrer:frameName: and showWindow.
* kwq/KWQKHTMLPartBrowserExtension.mm:
(KHTMLPartBrowserExtension::createNewWindow): Call createWindowWithURL,
and then showWindow after the window is set up. Also change the code that
flips coordinates to always use the height of the first screen instead of
using the height of the screen the window is on, which sounds right, but
is wrong.
* kwq/KWQKHTMLPartImpl.mm:
(KWQKHTMLPartImpl::bridgeForFrameName): Call createWindowWithURL and then
showWindow in the case where we create a window.
(KWQKHTMLPartImpl::urlSelected): Remove unused command-click code. The real
command-click code is in the browser now.
2002-10-09 Darin Adler <darin@apple.com>
 
- fixed 3069749 -- crash in QString during third run of cvs-base
......
......@@ -118,7 +118,8 @@ WebCoreBridge *KWQKHTMLPartImpl::bridgeForFrameName(const QString &frameName)
frame = [_bridge frameNamed:frameName.getNSString()];
}
if (frame == nil) {
frame = [_bridge openNewWindowWithURL:nil referrer:nil frameName:frameName.getNSString()];
frame = [_bridge createWindowWithURL:nil referrer:nil frameName:frameName.getNSString()];
[frame showWindow];
}
}
......@@ -168,12 +169,6 @@ void KWQKHTMLPartImpl::urlSelected(const KURL &url, int button, int state, const
return;
}
// Open new window on command-click
if (state & MetaButton) {
[_bridge openNewWindowWithURL:cocoaURL referrer:referrer(args) frameName:nil];
return;
}
WebCoreBridge *targetBridge = bridgeForFrameName(args.frameName);
// FIXME: KHTML does this in openURL -- we should do this at that level so we don't
......
......@@ -77,7 +77,7 @@ void KHTMLPartBrowserExtension::createNewWindow(const KURL &url,
}
NSURL *cocoaURL = url.isEmpty() ? nil : url.getNSURL();
bridge = [m_part->impl->bridge() openNewWindowWithURL:cocoaURL
bridge = [m_part->impl->bridge() createWindowWithURL:cocoaURL
referrer:KWQKHTMLPartImpl::referrer(urlArgs)
frameName:frameName];
......@@ -98,8 +98,6 @@ void KHTMLPartBrowserExtension::createNewWindow(const KURL &url,
}
if (winArgs.xSet || winArgs.ySet || winArgs.widthSet || winArgs.heightSet) {
NSRect screenFrame = [[[bridge window] screen] frame];
NSRect frame = [[bridge window] frame];
if (winArgs.xSet) {
......@@ -107,10 +105,11 @@ void KHTMLPartBrowserExtension::createNewWindow(const KURL &url,
}
if (winArgs.ySet) {
if (winArgs.heightSet) {
frame.origin.y = screenFrame.size.height - winArgs.y + frame.size.height - winArgs.height;
float heightForFlip = NSMaxY([[[NSScreen screens] objectAtIndex:0] frame]);
if (winArgs.heightSet) {
frame.origin.y = heightForFlip - winArgs.y + frame.size.height - winArgs.height;
} else {
frame.origin.y = screenFrame.size.height - winArgs.y;
frame.origin.y = heightForFlip - winArgs.y;
}
}
......@@ -125,6 +124,8 @@ void KHTMLPartBrowserExtension::createNewWindow(const KURL &url,
[bridge setWindowFrame:frame];
}
[bridge showWindow];
*partResult = [bridge part];
}
......
......@@ -118,7 +118,8 @@ WebCoreBridge *KWQKHTMLPartImpl::bridgeForFrameName(const QString &frameName)
frame = [_bridge frameNamed:frameName.getNSString()];
}
if (frame == nil) {
frame = [_bridge openNewWindowWithURL:nil referrer:nil frameName:frameName.getNSString()];
frame = [_bridge createWindowWithURL:nil referrer:nil frameName:frameName.getNSString()];
[frame showWindow];
}
}
......@@ -168,12 +169,6 @@ void KWQKHTMLPartImpl::urlSelected(const KURL &url, int button, int state, const
return;
}
// Open new window on command-click
if (state & MetaButton) {
[_bridge openNewWindowWithURL:cocoaURL referrer:referrer(args) frameName:nil];
return;
}
WebCoreBridge *targetBridge = bridgeForFrameName(args.frameName);
// FIXME: KHTML does this in openURL -- we should do this at that level so we don't
......
......@@ -154,7 +154,9 @@ typedef khtml::RenderPart KHTMLRenderPart;
- (void)loadURL:(NSURL *)URL referrer:(NSString *)referrer;
- (void)postWithURL:(NSURL *)URL referrer:(NSString *)referrer data:(NSData *)data contentType:(NSString *)contentType;
- (WebCoreBridge *)openNewWindowWithURL:(NSURL *)URL referrer:(NSString *)referrer frameName:(NSString *)name;
- (WebCoreBridge *)createWindowWithURL:(NSURL *)URL referrer:(NSString *)referrer frameName:(NSString *)name;
- (void)showWindow;
- (NSString *)userAgentForURL:(NSURL *)URL;
......
2002-10-09 Darin Adler <darin@apple.com>
WebKit support for creating windows and then showing them later
after setting them up.
* WebCoreSupport.subproj/WebBridge.m:
(-[WebBridge createWindowWithURL:referrer:frameName:]): Replaced the old
openNewWindowWithURL with this. It calls the new window operations delegate
method.
(-[WebBridge showWindow]): Added. Calls the window operations delegate showWindow method.
(-[WebBridge createChildFrameNamed:withURL:referrer:renderPart:allowsScrolling:marginWidth:marginHeight:]):
Call _createFrameNamed instead of createFrameNamed.
* WebView.subproj/WebWindowOperationsDelegate.h: Replaced the openNewWindowWithURL
method with a new method named createWindowWithURL. Added showWindow and showWindowBehindFrontmost.
* WebView.subproj/WebControllerPrivate.h: Renamed createFrameNamed to _createFrameNamed
and removed the data source parameter. Added _openNewWindowWithURL:referrer:behind:
for the convenience of those who used to call the window operations delegate directly
to open the window.
* WebView.subproj/WebControllerPrivate.m:
(-[WebController _createFrameNamed:inParent:allowsScrolling:]): Renamed, and removed
the data source parameter.
(-[WebController _openNewWindowWithURL:referrer:behind:]): Added.
* Plugins.subproj/WebBaseNetscapePluginView.m:
(-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]):
* WebView.subproj/WebDefaultContextMenuDelegate.m:
(-[WebDefaultContextMenuDelegate openNewWindowWithURL:referrer:]):
* WebView.subproj/WebFrame.m: (-[WebFrame frameNamed:]):
* WebView.subproj/WebHTMLViewPrivate.m:
(-[WebHTMLView _continueAfterClickPolicyForEvent:]):
Use a private WebController method instead of calling the delegate directly,
because it now takes two method calls to create and display a new window.
* Misc.subproj/WebNSViewExtras.m:
* WebCoreSupport.subproj/WebSubresourceClient.m:
* WebView.subproj/WebController.m:
* WebView.subproj/WebDataSource.m:
* WebView.subproj/WebFramePrivate.m:
* WebView.subproj/WebHTMLView.m:
* WebView.subproj/WebMainResourceClient.m:
* WebView.subproj/WebPreferences.m:
* WebView.subproj/WebView.m:
* WebView.subproj/WebViewPrivate.m:
Tweaked comments.
2002-10-09 Darin Adler <darin@apple.com>
 
* WebCoreSupport.subproj/WebImageRenderer.m:
......
2002-10-09 Darin Adler <darin@apple.com>
WebKit support for creating windows and then showing them later
after setting them up.
* WebCoreSupport.subproj/WebBridge.m:
(-[WebBridge createWindowWithURL:referrer:frameName:]): Replaced the old
openNewWindowWithURL with this. It calls the new window operations delegate
method.
(-[WebBridge showWindow]): Added. Calls the window operations delegate showWindow method.
(-[WebBridge createChildFrameNamed:withURL:referrer:renderPart:allowsScrolling:marginWidth:marginHeight:]):
Call _createFrameNamed instead of createFrameNamed.
* WebView.subproj/WebWindowOperationsDelegate.h: Replaced the openNewWindowWithURL
method with a new method named createWindowWithURL. Added showWindow and showWindowBehindFrontmost.
* WebView.subproj/WebControllerPrivate.h: Renamed createFrameNamed to _createFrameNamed
and removed the data source parameter. Added _openNewWindowWithURL:referrer:behind:
for the convenience of those who used to call the window operations delegate directly
to open the window.
* WebView.subproj/WebControllerPrivate.m:
(-[WebController _createFrameNamed:inParent:allowsScrolling:]): Renamed, and removed
the data source parameter.
(-[WebController _openNewWindowWithURL:referrer:behind:]): Added.
* Plugins.subproj/WebBaseNetscapePluginView.m:
(-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]):
* WebView.subproj/WebDefaultContextMenuDelegate.m:
(-[WebDefaultContextMenuDelegate openNewWindowWithURL:referrer:]):
* WebView.subproj/WebFrame.m: (-[WebFrame frameNamed:]):
* WebView.subproj/WebHTMLViewPrivate.m:
(-[WebHTMLView _continueAfterClickPolicyForEvent:]):
Use a private WebController method instead of calling the delegate directly,
because it now takes two method calls to create and display a new window.
* Misc.subproj/WebNSViewExtras.m:
* WebCoreSupport.subproj/WebSubresourceClient.m:
* WebView.subproj/WebController.m:
* WebView.subproj/WebDataSource.m:
* WebView.subproj/WebFramePrivate.m:
* WebView.subproj/WebHTMLView.m:
* WebView.subproj/WebMainResourceClient.m:
* WebView.subproj/WebPreferences.m:
* WebView.subproj/WebView.m:
* WebView.subproj/WebViewPrivate.m:
Tweaked comments.
2002-10-09 Darin Adler <darin@apple.com>
 
* WebCoreSupport.subproj/WebImageRenderer.m:
......
/*
WebNSViewExtras.mm
WebNSViewExtras.m
Copyright (c) 2002, Apple, Inc. All rights reserved.
*/
......
......@@ -787,7 +787,7 @@ - (NPError)loadRequest:(WebResourceRequest *)request inTarget:(NSString *)target
frame = [[self webFrame] frameNamed:target];
if(!frame){
// FIXME: Why is it OK to just discard all the attributes in this case?
[[[self controller] windowOperationsDelegate] openNewWindowWithURL:URL referrer:nil behind:NO];
[[self controller] _openNewWindowWithURL:URL referrer:nil behind:NO];
// FIXME: Need to send NPP_URLNotify at the right time.
// FIXME: Need to name new frame
if(notifyData){
......
/*
WebBridge.mm
WebBridge.m
Copyright (c) 2002, Apple, Inc. All rights reserved.
*/
......@@ -67,15 +67,20 @@ - (WebCoreBridge *)descendantFrameNamed:(NSString *)name
return [[frame frameNamed:name] _bridge];
}
- (WebCoreBridge *)openNewWindowWithURL:(NSURL *)URL referrer:(NSString *)referrer frameName:(NSString *)name
- (WebCoreBridge *)createWindowWithURL:(NSURL *)URL referrer:(NSString *)referrer frameName:(NSString *)name
{
ASSERT(frame != nil);
WebController *newController = [[[frame controller] windowOperationsDelegate] openNewWindowWithURL:URL referrer:referrer behind:NO];
WebController *newController = [[[frame controller] windowOperationsDelegate] createWindowWithURL:URL referrer:referrer];
[newController _setTopLevelFrameName:name];
return [[newController mainFrame] _bridge];
}
- (void)showWindow
{
[[[frame controller] windowOperationsDelegate] showWindow];
}
- (BOOL)areToolbarsVisible
{
ASSERT(frame != nil);
......@@ -290,7 +295,7 @@ - (WebCoreBridge *)createChildFrameNamed:(NSString *)frameName
allowsScrolling:(BOOL)allowsScrolling marginWidth:(int)width marginHeight:(int)height
{
ASSERT(frame != nil);
WebFrame *newFrame = [[frame controller] createFrameNamed:frameName for:nil inParent:frame allowsScrolling:allowsScrolling];
WebFrame *newFrame = [[frame controller] _createFrameNamed:frameName inParent:frame allowsScrolling:allowsScrolling];
if (newFrame == nil) {
return nil;
}
......@@ -302,8 +307,7 @@ - (WebCoreBridge *)createChildFrameNamed:(NSString *)frameName
[[newFrame _bridge] loadURL:URL referrer:referrer];
// Set the load type so this load doesn't end up in the back
// forward list.
// Set the load type so this load doesn't end up in the back/forward list.
[newFrame _setLoadType:WebFrameLoadTypeInternal];
return [newFrame _bridge];
......
/*
WebSubresourceClient.mm
WebSubresourceClient.m
Copyright (c) 2002, Apple Computer, Inc. All rights reserved.
*/
......
/*
WebSubresourceClient.mm
WebSubresourceClient.m
Copyright (c) 2002, Apple Computer, Inc. All rights reserved.
*/
......
/*
WebController.mm
WebController.m
Copyright 2001, 2002 Apple, Inc. All rights reserved.
*/
......
/*
WebController.mm
WebController.m
Copyright 2001, Apple, Inc. All rights reserved.
*/
......@@ -13,13 +13,13 @@
@public
WebFrame *mainFrame;
id<WebWindowOperationsDelegate> windowContext;
id<WebResourceLoadDelegate> resourceProgressDelegate;
id<WebResourceLoadDelegate> downloadProgressDelegate;
id<WebContextMenuDelegate> contextMenuDelegate;
id<WebContextMenuDelegate> defaultContextMenuDelegate;
id<WebControllerPolicyDelegate> policyDelegate;
id<WebLocationChangeDelegate> locationChangeDelegate;
id <WebWindowOperationsDelegate> windowContext;
id <WebResourceLoadDelegate> resourceProgressDelegate;
id <WebResourceLoadDelegate> downloadProgressDelegate;
id <WebContextMenuDelegate> contextMenuDelegate;
id <WebContextMenuDelegate> defaultContextMenuDelegate;
id <WebControllerPolicyDelegate> policyDelegate;
id <WebLocationChangeDelegate> locationChangeDelegate;
WebBackForwardList *backForwardList;
BOOL useBackForwardList;
......@@ -39,21 +39,16 @@
@interface WebController (WebPrivate)
/*
Called when a data source needs to create a frame. This method encapsulates the
specifics of creating and initializing a view of the appropriate class.
*/
- (WebFrame *)createFrameNamed: (NSString *)fname for: (WebDataSource *)child inParent: (WebFrame *)parent allowsScrolling: (BOOL)allowsScrolling;
- (WebFrame *)_createFrameNamed:(NSString *)name inParent:(WebFrame *)parent allowsScrolling:(BOOL)allowsScrolling;
- (id<WebContextMenuDelegate>)_defaultContextMenuDelegate;
- (void)_receivedProgressForResourceHandle: (WebResourceHandle *)resourceHandle fromDataSource: (WebDataSource *)dataSource complete:(BOOL)isComplete;
- (void)_receivedError: (WebError *)error forResourceHandle: (WebResourceHandle *)resourceHandle fromDataSource: (WebDataSource *)dataSource;
- (void)_mainReceivedProgressForResourceHandle: (WebResourceHandle *)resourceHandle bytesSoFar:(unsigned)bytesSoFar fromDataSource: (WebDataSource *)dataSource complete:(BOOL)isComplete;
- (void)_mainReceivedError: (WebError *)error forResourceHandle: (WebResourceHandle *)resourceHandle fromDataSource: (WebDataSource *)dataSource;
- (void)_didStartLoading: (NSURL *)URL;
- (void)_didStopLoading: (NSURL *)URL;
+ (NSString *)_MIMETypeForFile: (NSString *)path;
- (id <WebContextMenuDelegate>)_defaultContextMenuDelegate;
- (void)_receivedProgressForResourceHandle:(WebResourceHandle *)resourceHandle fromDataSource:(WebDataSource *)dataSource complete:(BOOL)isComplete;
- (void)_receivedError:(WebError *)error forResourceHandle:(WebResourceHandle *)resourceHandle fromDataSource:(WebDataSource *)dataSource;
- (void)_mainReceivedProgressForResourceHandle:(WebResourceHandle *)resourceHandle bytesSoFar:(unsigned)bytesSoFar fromDataSource:(WebDataSource *)dataSource complete:(BOOL)isComplete;
- (void)_mainReceivedError:(WebError *)error forResourceHandle:(WebResourceHandle *)resourceHandle fromDataSource:(WebDataSource *)dataSource;
- (void)_didStartLoading:(NSURL *)URL;
- (void)_didStopLoading:(NSURL *)URL;
+ (NSString *)_MIMETypeForFile:(NSString *)path;
- (void)_downloadURL:(NSURL *)URL toPath:(NSString *)path;
- (BOOL)_defersCallbacks;
......@@ -62,4 +57,6 @@
- (void)_setTopLevelFrameName:(NSString *)name;
- (WebFrame *)_frameInThisWindowNamed:(NSString *)name;
- (WebController *)_openNewWindowWithURL:(NSURL *)URL referrer:(NSString *)referrer behind:(BOOL)behind;
@end
/*
WebControllerPrivate.mm
WebControllerPrivate.m
Copyright (c) 2001, 2002, Apple, Inc. All rights reserved.
*/
......@@ -78,25 +78,20 @@ - (void)dealloc
@implementation WebController (WebPrivate)
- (WebFrame *)createFrameNamed: (NSString *)fname for: (WebDataSource *)childDataSource inParent: (WebFrame *)parent allowsScrolling: (BOOL)allowsScrolling
- (WebFrame *)_createFrameNamed:(NSString *)fname inParent:(WebFrame *)parent allowsScrolling:(BOOL)allowsScrolling
{
WebView *childView;
WebFrame *newFrame;
WebView *childView = [[WebView alloc] initWithFrame:NSMakeRect(0,0,0,0)];
childView = [[WebView alloc] initWithFrame: NSMakeRect(0,0,0,0)];
newFrame = [[WebFrame alloc] initWithName: fname webView: childView provisionalDataSource: childDataSource controller: self];
[parent _addChild: newFrame];
[childView _setController:self];
[childView setAllowsScrolling:allowsScrolling];
[newFrame release];
WebFrame *newFrame = [[WebFrame alloc] initWithName:fname webView:childView provisionalDataSource:nil controller:self];
[childView _setController: self];
[childDataSource _setController: self];
[childView release];
[childView setAllowsScrolling: allowsScrolling];
[parent _addChild:newFrame];
[childView release];
[newFrame release];
return newFrame;
}
......@@ -255,4 +250,15 @@ - (WebFrame *)_frameInThisWindowNamed:(NSString *)name
}
}
- (WebController *)_openNewWindowWithURL:(NSURL *)URL referrer:(NSString *)referrer behind:(BOOL)behind
{
WebController *newWindowController = [[self windowOperationsDelegate] createWindowWithURL:URL referrer:referrer];
if (behind) {
[[newWindowController windowOperationsDelegate] showWindowBehindFrontmost];
} else {
[[newWindowController windowOperationsDelegate] showWindow];
}
return newWindowController;
}
@end
/*
WebDataSource.mm
WebDataSource.m
Copyright 2001, 2002, Apple, Inc. All rights reserved.
*/
......
......@@ -100,7 +100,7 @@ - (void)openNewWindowWithURL:(NSURL *)URL referrer:(NSString *)referrer
{
WebFrame *webFrame = [element objectForKey:WebElementFrameKey];
WebController *controller = [webFrame controller];
[[controller windowOperationsDelegate] openNewWindowWithURL:URL referrer:referrer behind:NO];
[controller _openNewWindowWithURL:URL referrer:referrer behind:NO];
}
- (void)downloadURL:(NSURL *)URL
......
......@@ -9,7 +9,7 @@
#import <WebKit/WebBackForwardList.h>
#import <WebKit/WebBridge.h>
#import <WebKit/WebController.h>
#import <WebKit/WebControllerPrivate.h>
#import <WebKit/WebDataSourcePrivate.h>
#import <WebKit/WebFramePrivate.h>
#import <WebKit/WebHistoryItem.h>
......@@ -241,9 +241,7 @@ - (WebFrame *)frameNamed:(NSString *)name
}
if ([name isEqualToString:@"_blank"]) {
WebController *newController = [[[self controller] windowOperationsDelegate] openNewWindowWithURL:nil referrer:nil behind:NO];
[[[[newController windowOperationsDelegate] window] windowController] showWindow:nil];
return [newController mainFrame];
return [[[self controller] _openNewWindowWithURL:nil referrer:nil behind:NO] mainFrame];
}
// Now search the name space associated with this frame's controller.
......
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