Commit d1356935 authored by darin's avatar darin
Browse files

WebKit:

	More work on "open window behind".

        * WebView.subproj/WebControllerPolicyDelegate.h: Add new OpenNewWindowBehind
	constants to the enums.

        * WebView.subproj/WebWindowOperationsDelegate.h: Add a behind: parameter to
	the openNewWindowWithURL method.

        * WebView.subproj/WebHTMLViewPrivate.m:
        (-[WebHTMLView _continueAfterClickPolicyForEvent:]): In the new
	WebClickPolicyOpenNewWindowBehind case, pass YES for behind.

        * Plugins.subproj/WebBaseNetscapePluginView.m:
        (-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]):
        * WebCoreSupport.subproj/WebBridge.m:
        (-[WebBridge openNewWindowWithURL:referrer:frameName:]):
        * WebView.subproj/WebDefaultContextMenuDelegate.m:
        (-[WebDefaultContextMenuDelegate openNewWindowWithURL:referrer:]):
        * WebView.subproj/WebFrame.m:
        (-[WebFrame frameNamed:]):
	Pass NO for behind.

WebBrowser:

	More work on "open window behind".

        * BrowserWebController.m:
        (-[BrowserWebController openNewWindowWithURL:referrer:behind:]): Add new behind
	parameter to match change to window operations delegate in WebKit.
        (-[BrowserWebController clickPolicyForElement:button:modifierFlags:]): Use the
	WebClickPolicyOpenNewWindowBehind policy if the shift key and command key are down.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2227 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent f5e58ed9
2002-10-02 Darin Adler <darin@apple.com>
More work on "open window behind".
* WebView.subproj/WebControllerPolicyDelegate.h: Add new OpenNewWindowBehind
constants to the enums.
* WebView.subproj/WebWindowOperationsDelegate.h: Add a behind: parameter to
the openNewWindowWithURL method.
* WebView.subproj/WebHTMLViewPrivate.m:
(-[WebHTMLView _continueAfterClickPolicyForEvent:]): In the new
WebClickPolicyOpenNewWindowBehind case, pass YES for behind.
* Plugins.subproj/WebBaseNetscapePluginView.m:
(-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]):
* WebCoreSupport.subproj/WebBridge.m:
(-[WebBridge openNewWindowWithURL:referrer:frameName:]):
* WebView.subproj/WebDefaultContextMenuDelegate.m:
(-[WebDefaultContextMenuDelegate openNewWindowWithURL:referrer:]):
* WebView.subproj/WebFrame.m:
(-[WebFrame frameNamed:]):
Pass NO for behind.
2002-10-02 Darin Adler <darin@apple.com>
 
Cut down on unnecessary use of WebFoundation private stuff.
......
2002-10-02 Darin Adler <darin@apple.com>
More work on "open window behind".
* WebView.subproj/WebControllerPolicyDelegate.h: Add new OpenNewWindowBehind
constants to the enums.
* WebView.subproj/WebWindowOperationsDelegate.h: Add a behind: parameter to
the openNewWindowWithURL method.
* WebView.subproj/WebHTMLViewPrivate.m:
(-[WebHTMLView _continueAfterClickPolicyForEvent:]): In the new
WebClickPolicyOpenNewWindowBehind case, pass YES for behind.
* Plugins.subproj/WebBaseNetscapePluginView.m:
(-[WebBaseNetscapePluginView loadRequest:inTarget:withNotifyData:]):
* WebCoreSupport.subproj/WebBridge.m:
(-[WebBridge openNewWindowWithURL:referrer:frameName:]):
* WebView.subproj/WebDefaultContextMenuDelegate.m:
(-[WebDefaultContextMenuDelegate openNewWindowWithURL:referrer:]):
* WebView.subproj/WebFrame.m:
(-[WebFrame frameNamed:]):
Pass NO for behind.
2002-10-02 Darin Adler <darin@apple.com>
 
Cut down on unnecessary use of WebFoundation private stuff.
......
......@@ -774,7 +774,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];
[[[self controller] windowOperationsDelegate] openNewWindowWithURL:URL referrer:nil behind:NO];
// FIXME: Need to send NPP_URLNotify at the right time.
// FIXME: Need to name new frame
if(notifyData){
......
......@@ -70,7 +70,7 @@ - (WebCoreBridge *)openNewWindowWithURL:(NSURL *)URL referrer:(NSString *)referr
{
ASSERT(frame != nil);
WebController *newController = [[[frame controller] windowOperationsDelegate] openNewWindowWithURL:URL referrer:referrer];
WebController *newController = [[[frame controller] windowOperationsDelegate] openNewWindowWithURL:URL referrer:referrer behind:NO];
[newController _setTopLevelFrameName:name];
WebFrame *newFrame = [newController mainFrame];
return [newFrame _bridge];
......
......@@ -20,6 +20,7 @@
@constant WebPolicyOpenURL Open the URL in another application.
@constant WebPolicySaveAndOpen Save and open the resource in another application.
@constant WebPolicyOpenNewWindow Open the resource in another window.
@constant WebPolicyOpenNewWindowBehind Open the resource in another window behind this window.
@constant WebPolicyIgnore Do nothing with the resource.
*/
typedef enum {
......@@ -30,6 +31,7 @@ typedef enum {
WebPolicyOpenURL,
WebPolicySaveAndOpen,
WebPolicyOpenNewWindow,
WebPolicyOpenNewWindowBehind,
WebPolicyIgnore
} WebPolicyAction;
......@@ -37,6 +39,7 @@ typedef enum {
@enum WebClickAction
@constant WebClickPolicyShow Have WebKit show the clicked URL.
@constant WebClickPolicyOpenNewWindow Open the clicked URL in another window.
@constant WebClickPolicyOpenNewWindowBehind Open the clicked URL in another window behind this window.
@constant WebClickPolicySave Save the clicked URL to disk.
@constant WebClickPolicySaveAndOpenExternally Save the clicked URL to disk and open the file in another application.
@constant WebClickPolicyIgnore Do nothing with the clicked URL.
......@@ -44,6 +47,7 @@ typedef enum {
typedef enum {
WebClickPolicyShow = WebPolicyUse,
WebClickPolicyOpenNewWindow = WebPolicyOpenNewWindow,
WebClickPolicyOpenNewWindowBehind = WebPolicyOpenNewWindowBehind,
WebClickPolicySave = WebPolicySave,
WebClickPolicySaveAndOpenExternally = WebPolicySaveAndOpen,
WebClickPolicyIgnore = WebPolicyIgnore
......
......@@ -99,7 +99,7 @@ - (void)openNewWindowWithURL:(NSURL *)URL referrer:(NSString *)referrer
{
WebFrame *webFrame = [element objectForKey:WebElementFrameKey];
WebController *controller = [webFrame controller];
[[controller windowOperationsDelegate] openNewWindowWithURL:URL referrer:referrer];
[[controller windowOperationsDelegate] openNewWindowWithURL:URL referrer:referrer behind:NO];
}
- (void)downloadURL:(NSURL *)URL
......
......@@ -260,7 +260,7 @@ - (WebFrame *)frameNamed:(NSString *)name
}
else if ([name isEqualToString:@"_blank"]){
WebController *newController = [[[self controller] windowOperationsDelegate] openNewWindowWithURL:nil referrer:nil];
WebController *newController = [[[self controller] windowOperationsDelegate] openNewWindowWithURL:nil referrer:nil behind:NO];
[[[[newController windowOperationsDelegate] window] windowController] showWindow:nil];
return [newController mainFrame];
......
......@@ -152,7 +152,10 @@ - (BOOL)_continueAfterClickPolicyForEvent:(NSEvent *)event
case WebClickPolicyShow:
return YES;
case WebClickPolicyOpenNewWindow:
[[controller windowOperationsDelegate] openNewWindowWithURL:URL referrer:nil];
[[controller windowOperationsDelegate] openNewWindowWithURL:URL referrer:nil behind:NO];
break;
case WebClickPolicyOpenNewWindowBehind:
[[controller windowOperationsDelegate] openNewWindowWithURL:URL referrer:nil behind:YES];
break;
case WebClickPolicySave:
case WebClickPolicySaveAndOpenExternally:
......
......@@ -20,6 +20,7 @@
@constant WebPolicyOpenURL Open the URL in another application.
@constant WebPolicySaveAndOpen Save and open the resource in another application.
@constant WebPolicyOpenNewWindow Open the resource in another window.
@constant WebPolicyOpenNewWindowBehind Open the resource in another window behind this window.
@constant WebPolicyIgnore Do nothing with the resource.
*/
typedef enum {
......@@ -30,6 +31,7 @@ typedef enum {
WebPolicyOpenURL,
WebPolicySaveAndOpen,
WebPolicyOpenNewWindow,
WebPolicyOpenNewWindowBehind,
WebPolicyIgnore
} WebPolicyAction;
......@@ -37,6 +39,7 @@ typedef enum {
@enum WebClickAction
@constant WebClickPolicyShow Have WebKit show the clicked URL.
@constant WebClickPolicyOpenNewWindow Open the clicked URL in another window.
@constant WebClickPolicyOpenNewWindowBehind Open the clicked URL in another window behind this window.
@constant WebClickPolicySave Save the clicked URL to disk.
@constant WebClickPolicySaveAndOpenExternally Save the clicked URL to disk and open the file in another application.
@constant WebClickPolicyIgnore Do nothing with the clicked URL.
......@@ -44,6 +47,7 @@ typedef enum {
typedef enum {
WebClickPolicyShow = WebPolicyUse,
WebClickPolicyOpenNewWindow = WebPolicyOpenNewWindow,
WebClickPolicyOpenNewWindowBehind = WebPolicyOpenNewWindowBehind,
WebClickPolicySave = WebPolicySave,
WebClickPolicySaveAndOpenExternally = WebPolicySaveAndOpen,
WebClickPolicyIgnore = WebPolicyIgnore
......
......@@ -22,9 +22,10 @@
@abstract Open a new window and load the specified URL.
@param URL The URL to load.
@param referrer The referrer to use when loading the URL.
@param behind YES to open the window behind this one, NO to open it in front.
@result The WebController for the WebView in the new window.
*/
- (WebController *)openNewWindowWithURL:(NSURL *)URL referrer:(NSString *)referrer;
- (WebController *)openNewWindowWithURL:(NSURL *)URL referrer:(NSString *)referrer behind:(BOOL)behind;
/*!
@method setStatusText:
......
......@@ -22,9 +22,10 @@
@abstract Open a new window and load the specified URL.
@param URL The URL to load.
@param referrer The referrer to use when loading the URL.
@param behind YES to open the window behind this one, NO to open it in front.
@result The WebController for the WebView in the new window.
*/
- (WebController *)openNewWindowWithURL:(NSURL *)URL referrer:(NSString *)referrer;
- (WebController *)openNewWindowWithURL:(NSURL *)URL referrer:(NSString *)referrer behind:(BOOL)behind;
/*!
@method setStatusText:
......
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