summaryrefslogtreecommitdiff
path: root/Source/WebKit/chromium/src/ChromeClientImpl.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-03-12 14:11:15 +0100
committerSimon Hausmann <simon.hausmann@nokia.com>2012-03-12 14:11:15 +0100
commitdd91e772430dc294e3bf478c119ef8d43c0a3358 (patch)
tree6f33ce4d5872a5691e0291eb45bf6ab373a5f567 /Source/WebKit/chromium/src/ChromeClientImpl.cpp
parentad0d549d4cc13433f77c1ac8f0ab379c83d93f28 (diff)
downloadqtwebkit-dd91e772430dc294e3bf478c119ef8d43c0a3358.tar.gz
Imported WebKit commit 3db4eb1820ac8fb03065d7ea73a4d9db1e8fea1a (http://svn.webkit.org/repository/webkit/trunk@110422)
This includes build fixes for the latest qtbase/qtdeclarative as well as the final QML2 API.
Diffstat (limited to 'Source/WebKit/chromium/src/ChromeClientImpl.cpp')
-rw-r--r--Source/WebKit/chromium/src/ChromeClientImpl.cpp36
1 files changed, 28 insertions, 8 deletions
diff --git a/Source/WebKit/chromium/src/ChromeClientImpl.cpp b/Source/WebKit/chromium/src/ChromeClientImpl.cpp
index 45a813859..ad35382b9 100644
--- a/Source/WebKit/chromium/src/ChromeClientImpl.cpp
+++ b/Source/WebKit/chromium/src/ChromeClientImpl.cpp
@@ -136,6 +136,7 @@ ChromeClientImpl::ChromeClientImpl(WebViewImpl* webView)
, m_scrollbarsVisible(true)
, m_menubarVisible(true)
, m_resizable(true)
+ , m_nextNewWindowNavigationPolicy(WebNavigationPolicyIgnore)
{
}
@@ -238,13 +239,23 @@ Page* ChromeClientImpl::createWindow(
if (!m_webView->client())
return 0;
+ // FrameLoaderClientImpl may have given us a policy to use for the next new
+ // window navigation. If not, determine the policy using the same logic as
+ // show().
+ WebNavigationPolicy policy;
+ if (m_nextNewWindowNavigationPolicy != WebNavigationPolicyIgnore) {
+ policy = m_nextNewWindowNavigationPolicy;
+ m_nextNewWindowNavigationPolicy = WebNavigationPolicyIgnore;
+ } else
+ policy = getNavigationPolicy();
+
WrappedResourceRequest request;
if (!r.resourceRequest().isEmpty())
request.bind(r.resourceRequest());
else if (!action.resourceRequest().isEmpty())
request.bind(action.resourceRequest());
WebViewImpl* newView = static_cast<WebViewImpl*>(
- m_webView->client()->createView(WebFrameImpl::fromFrame(frame), request, features, r.frameName()));
+ m_webView->client()->createView(WebFrameImpl::fromFrame(frame), request, features, r.frameName(), policy));
if (!newView)
return 0;
@@ -287,11 +298,8 @@ static inline bool currentEventShouldCauseBackgroundTab(const WebInputEvent* inp
return policy == WebNavigationPolicyNewBackgroundTab;
}
-void ChromeClientImpl::show()
+WebNavigationPolicy ChromeClientImpl::getNavigationPolicy()
{
- if (!m_webView->client())
- return;
-
// If our default configuration was modified by a script or wasn't
// created by a user gesture, then show as a popup. Else, let this
// new window be opened as a toplevel window.
@@ -306,8 +314,15 @@ void ChromeClientImpl::show()
policy = WebNavigationPolicyNewPopup;
if (currentEventShouldCauseBackgroundTab(WebViewImpl::currentInputEvent()))
policy = WebNavigationPolicyNewBackgroundTab;
+ return policy;
+}
+
+void ChromeClientImpl::show()
+{
+ if (!m_webView->client())
+ return;
- m_webView->client()->show(policy);
+ m_webView->client()->show(getNavigationPolicy());
}
bool ChromeClientImpl::canRunModal()
@@ -603,7 +618,7 @@ void ChromeClientImpl::mouseDidMoveOverElement(
Widget* widget = toRenderWidget(object)->widget();
if (widget && widget->isPluginContainer()) {
WebPluginContainerImpl* plugin = static_cast<WebPluginContainerImpl*>(widget);
- url = plugin->plugin()->linkAtPosition(result.point());
+ url = plugin->plugin()->linkAtPosition(result.roundedPoint());
}
}
}
@@ -802,6 +817,11 @@ void ChromeClientImpl::setCursorForPlugin(const WebCursorInfo& cursor)
setCursor(cursor);
}
+void ChromeClientImpl::setNewWindowNavigationPolicy(WebNavigationPolicy policy)
+{
+ m_nextNewWindowNavigationPolicy = policy;
+}
+
void ChromeClientImpl::formStateDidChange(const Node* node)
{
// The current history item is not updated yet. That happens lazily when
@@ -890,7 +910,7 @@ void ChromeClientImpl::attachRootGraphicsLayer(Frame* frame, GraphicsLayer* grap
void ChromeClientImpl::scheduleCompositingLayerSync()
{
- m_webView->setRootLayerNeedsDisplay();
+ m_webView->scheduleCompositingLayerSync();
}
ChromeClient::CompositingTriggerFlags ChromeClientImpl::allowedCompositingTriggers() const