Commit 7489b5a6 authored by tristan's avatar tristan

mac:

        Reviewed by Timothy Hatcher.
        
        This patch is for the WebKit side of <rdar://problem/5591115>.
        We need a way to tell context menu navigations, such as "Open in New Window"
        to override any sort of browser preference for tab based navigation.

        * WebCoreSupport/WebChromeClient.mm:
        (WebChromeClient::createWindow):
        Pass up the new preferredType parameter as a string.

WebCore:

        Reviewed by Timothy Hatcher.
        
        This patch is for the WebKit side of <rdar://problem/5591115>.
        We need a way to tell context menu navigations, such as "Open in New Window"
        to override any sort of browser preference for tab based navigation.

        * bridge/WindowFeatures.h:
        (WebCore::WindowFeatures::WindowFeatures):
        Added a new struct member var, preferredType
        and an accompanying enum type PreferredType
        to send a window type recommendation up to the Chrome. 
        
        * page/ContextMenuController.cpp:
        (WebCore::openNewWindow):
        Set the window features to recommend a new Window for
        "Open in New Window" context menu action.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27654 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 016eed14
2007-11-09 Tristan O'Tierney <tristan@apple.com>
Reviewed by Timothy Hatcher.
This patch is for the WebKit side of <rdar://problem/5591115>.
We need a way to tell context menu navigations, such as "Open in New Window"
to override any sort of browser preference for tab based navigation.
* bridge/WindowFeatures.h:
(WebCore::WindowFeatures::WindowFeatures):
Added a new struct member var, preferredType
and an accompanying enum type PreferredType
to send a window type recommendation up to the Chrome.
* page/ContextMenuController.cpp:
(WebCore::openNewWindow):
Set the window features to recommend a new Window for
"Open in New Window" context menu action.
2007-11-08 Adam Roben <aroben@apple.com>
Fix <rdar://5483519> Pressing Enter on selected buttons should fire onclick
......
......@@ -29,11 +29,17 @@
namespace WebCore {
struct WindowFeatures {
typedef enum {
PreferUnspecified,
PreferNewWindow,
PreferNewTab
} PreferredType;
WindowFeatures()
: xSet(false), ySet(false), widthSet(false), heightSet(false),
menuBarVisible(true), statusBarVisible(true), toolBarVisible(true),
locationBarVisible(true), scrollbarsVisible(true), resizable(true),
fullscreen(false), dialog(false)
fullscreen(false), dialog(false), preferredType(PreferUnspecified)
{}
float x;
......@@ -54,6 +60,7 @@ struct WindowFeatures {
bool fullscreen;
bool dialog;
PreferredType preferredType;
};
} // namespace WebCore
......
......@@ -110,6 +110,7 @@ static void openNewWindow(const KURL& urlToLoad, Frame* frame)
{
if (Page* oldPage = frame->page()) {
WindowFeatures features;
features.preferredType = WindowFeatures::PreferNewWindow;
if (Page* newPage = oldPage->chrome()->createWindow(frame,
FrameLoadRequest(ResourceRequest(urlToLoad, frame->loader()->outgoingReferrer())), features))
newPage->chrome()->show();
......
2007-11-09 Tristan O'Tierney <tristan@apple.com>
Reviewed by Timothy Hatcher.
This patch is for the WebKit side of <rdar://problem/5591115>.
We need a way to tell context menu navigations, such as "Open in New Window"
to override any sort of browser preference for tab based navigation.
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::createWindow):
Pass up the new preferredType parameter as a string.
2007-11-09 Timothy Hatcher <timothy@apple.com>
Reviewed by John.
......
......@@ -173,6 +173,19 @@ Page* WebChromeClient::createWindow(Frame* frame, const FrameLoadRequest& reques
if (height)
[dictFeatures setObject:height forKey:@"height"];
switch (features.preferredType) {
case WindowFeatures::PreferNewWindow:
[dictFeatures setObject:@"window" forKey:@"preferredType"];
break;
case WindowFeatures::PreferNewTab:
[dictFeatures setObject:@"tab" forKey:@"preferredType"];
break;
case WindowFeatures::PreferUnspecified:
break;
default:
ASSERT_NOT_REACHED();
}
newWebView = CallUIDelegate(m_webView, @selector(webView:createWebViewWithRequest:windowFeatures:), URLRequest, dictFeatures);
[dictFeatures release];
......
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