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

Unified Diff: Source/web/ChromeClientImpl.cpp

Issue 23620020: Don't wait to notify client of spoof attempt if a modal dialog is created. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 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
Index: Source/web/ChromeClientImpl.cpp
diff --git a/Source/web/ChromeClientImpl.cpp b/Source/web/ChromeClientImpl.cpp
index 999d3b396ce895bb3f439cc95e406050d2b63427..ea26ec9f2ec09089a481ad6ca133b5db7cd476ef 100644
--- a/Source/web/ChromeClientImpl.cpp
+++ b/Source/web/ChromeClientImpl.cpp
@@ -399,6 +399,8 @@ bool ChromeClientImpl::canRunBeforeUnloadConfirmPanel()
bool ChromeClientImpl::runBeforeUnloadConfirmPanel(const String& message, Frame* frame)
{
if (m_webView->client()) {
+ if (frame->loader()->stateMachine()->isDisplayingInitialEmptyDocument())
+ frame->loader()->forceNotifyForInitialDocumentAccess();
return m_webView->client()->runModalBeforeUnloadDialog(
WebFrameImpl::fromFrame(frame), message);
}
@@ -424,6 +426,8 @@ void ChromeClientImpl::runJavaScriptAlert(Frame* frame, const String& message)
if (m_webView->client()) {
if (WebUserGestureIndicator::isProcessingUserGesture())
WebUserGestureIndicator::currentUserGestureToken().setJavascriptPrompt();
+ if (frame->loader()->stateMachine()->isDisplayingInitialEmptyDocument())
+ frame->loader()->forceNotifyForInitialDocumentAccess();
m_webView->client()->runModalAlertDialog(
WebFrameImpl::fromFrame(frame), message);
}
@@ -435,6 +439,8 @@ bool ChromeClientImpl::runJavaScriptConfirm(Frame* frame, const String& message)
if (m_webView->client()) {
if (WebUserGestureIndicator::isProcessingUserGesture())
WebUserGestureIndicator::currentUserGestureToken().setJavascriptPrompt();
+ if (frame->loader()->stateMachine()->isDisplayingInitialEmptyDocument())
+ frame->loader()->forceNotifyForInitialDocumentAccess();
return m_webView->client()->runModalConfirmDialog(
WebFrameImpl::fromFrame(frame), message);
}
@@ -450,6 +456,8 @@ bool ChromeClientImpl::runJavaScriptPrompt(Frame* frame,
if (m_webView->client()) {
if (WebUserGestureIndicator::isProcessingUserGesture())
WebUserGestureIndicator::currentUserGestureToken().setJavascriptPrompt();
+ if (frame->loader()->stateMachine()->isDisplayingInitialEmptyDocument())
darin (slow to review) 2013/09/03 23:21:45 It kind of sucks to repeat the stateMachine condit
Charlie Reis 2013/09/04 00:01:10 Fair point. I ended up putting it second in the i
+ frame->loader()->forceNotifyForInitialDocumentAccess();
WebString actualValue;
bool ok = m_webView->client()->runModalPromptDialog(
WebFrameImpl::fromFrame(frame),

Powered by Google App Engine
This is Rietveld 408576698