Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1264)

Unified Diff: Source/core/loader/FrameLoader.cpp

Issue 1152053006: Allow RemoteFrames to be navigated through targeted navigation. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/FrameLoader.cpp
diff --git a/Source/core/loader/FrameLoader.cpp b/Source/core/loader/FrameLoader.cpp
index f37d7a4ab0bbf399a4e53e16cd53daaa59b91427..ab7992842f1e082a9910555f689ecc6080f09961 100644
--- a/Source/core/loader/FrameLoader.cpp
+++ b/Source/core/loader/FrameLoader.cpp
@@ -55,6 +55,7 @@
#include "core/frame/FrameView.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/PinchViewport.h"
+#include "core/frame/RemoteFrame.h"
#include "core/frame/Settings.h"
#include "core/frame/csp/ContentSecurityPolicy.h"
#include "core/html/HTMLFormElement.h"
@@ -693,7 +694,7 @@ bool FrameLoader::prepareRequestForThisFrame(FrameLoadRequest& request)
return true;
}
-static bool shouldOpenInNewWindow(LocalFrame* targetFrame, const FrameLoadRequest& request, NavigationPolicy policy)
+static bool shouldOpenInNewWindow(Frame* targetFrame, const FrameLoadRequest& request, NavigationPolicy policy)
{
if (!targetFrame && !request.frameName().isEmpty())
return true;
@@ -778,12 +779,20 @@ void FrameLoader::load(const FrameLoadRequest& passedRequest)
if (!prepareRequestForThisFrame(request))
return;
- RefPtrWillBeRawPtr<LocalFrame> targetFrame = toLocalFrame(request.form() ? nullptr : m_frame->findFrameForNavigation(AtomicString(request.frameName()), *m_frame));
+ RefPtrWillBeRawPtr<Frame> targetFrame = request.form() ? nullptr : m_frame->findFrameForNavigation(AtomicString(request.frameName()), *m_frame);
if (targetFrame && targetFrame.get() != m_frame) {
bool wasInSamePage = targetFrame->page() == m_frame->page();
request.setFrameName("_self");
- targetFrame->loader().load(request);
+ if (targetFrame->isLocalFrame()) {
+ toLocalFrame(targetFrame.get())->loader().load(request);
Nate Chapin 2015/06/05 23:34:47 This feels like the wrong place for this logic. Co
nasko 2015/06/08 15:57:10 Done.
+ } else {
+ bool hasUserGesture = UserGestureIndicator::processingUserGesture();
+ toRemoteFrame(targetFrame.get())->navigate(
+ *passedRequest.originDocument(), passedRequest.resourceRequest().url(),
+ false, hasUserGesture ? UserGestureStatus::Active : UserGestureStatus::None);
+ }
+
Page* page = targetFrame->page();
if (!wasInSamePage && page)
page->chromeClient().focus();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698