Index: third_party/WebKit/Source/core/frame/LocalFrame.cpp |
diff --git a/third_party/WebKit/Source/core/frame/LocalFrame.cpp b/third_party/WebKit/Source/core/frame/LocalFrame.cpp |
index 16bb9bbbca38286bc035ee4e0b8247c36dd9b10b..455246e40e18ec3bbc57456cb5c97b84a929fba1 100644 |
--- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp |
+++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp |
@@ -257,6 +257,8 @@ void LocalFrame::navigate(Document& originDocument, const KURL& url, bool replac |
void LocalFrame::navigate(const FrameLoadRequest& request) |
{ |
+ if (!isNavigationAllowed()) |
+ return; |
m_loader.load(request); |
} |
@@ -878,6 +880,7 @@ inline LocalFrame::LocalFrame(FrameLoaderClient* client, FrameHost* host, FrameO |
, m_eventHandler(adoptPtrWillBeNoop(new EventHandler(this))) |
, m_console(FrameConsole::create(*this)) |
, m_inputMethodController(InputMethodController::create(*this)) |
+ , m_navigationDisableCount(0) |
, m_pageZoomFactor(parentPageZoomFactor(this)) |
, m_textZoomFactor(parentTextZoomFactor(this)) |
, m_inViewSourceMode(false) |
@@ -909,4 +912,15 @@ void LocalFrame::updateFrameSecurityOrigin() |
DEFINE_WEAK_IDENTIFIER_MAP(LocalFrame); |
+FrameNavigationDisabler::FrameNavigationDisabler(LocalFrame& frame) |
+ : m_frame(&frame) |
+{ |
+ m_frame->disableNavigation(); |
+} |
+ |
+FrameNavigationDisabler::~FrameNavigationDisabler() |
+{ |
+ m_frame->enableNavigation(); |
+} |
+ |
} // namespace blink |