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

Unified Diff: third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp

Issue 2079183002: Measure the usage of cross-origin modal dialogs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove { } around a single-line conditional body. Created 4 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 | third_party/WebKit/Source/core/frame/UseCounter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
diff --git a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
index 20a01b9f6b24d98edfe157a16ae76c19f7f7615c..e8858af8d9a127c8f92a273aca8651cefadeb058 100644
--- a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
+++ b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
@@ -764,6 +764,10 @@ void LocalDOMWindow::print(ScriptState* scriptState)
m_shouldPrintWhenFinishedLoading = true;
return;
}
+
+ if (frame()->isCrossOrigin())
+ UseCounter::count(frame()->document(), UseCounter::CrossOriginWindowPrint);
+
m_shouldPrintWhenFinishedLoading = false;
host->chromeClient().print(frame());
}
@@ -802,6 +806,9 @@ void LocalDOMWindow::alert(ScriptState* scriptState, const String& message)
if (!host)
return;
+ if (frame()->isCrossOrigin())
+ UseCounter::count(frame()->document(), UseCounter::CrossOriginWindowAlert);
+
host->chromeClient().openJavaScriptAlert(frame(), message);
}
@@ -832,6 +839,9 @@ bool LocalDOMWindow::confirm(ScriptState* scriptState, const String& message)
if (!host)
return false;
+ if (frame()->isCrossOrigin())
+ UseCounter::count(frame()->document(), UseCounter::CrossOriginWindowConfirm);
+
return host->chromeClient().openJavaScriptConfirm(frame(), message);
}
@@ -866,6 +876,9 @@ String LocalDOMWindow::prompt(ScriptState* scriptState, const String& message, c
if (host->chromeClient().openJavaScriptPrompt(frame(), message, defaultValue, returnValue))
return returnValue;
+ if (frame()->isCrossOrigin())
+ UseCounter::count(frame()->document(), UseCounter::CrossOriginWindowPrompt);
+
return String();
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698