Chromium Code Reviews| 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..a956131d01253adcebf09c72beb48f7f2fbd9329 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()) { |
|
dcheng
2016/06/21 11:20:02
Nit: no { } around a single-line conditional body
|
| + UseCounter::count(frame()->document(), UseCounter::CrossOriginWindowPrint); |
| + } |
| m_shouldPrintWhenFinishedLoading = false; |
| host->chromeClient().print(frame()); |
| } |
| @@ -802,6 +806,10 @@ 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 +840,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 +877,10 @@ 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(); |
| } |