Commit 5498674d authored by Mustaq Ahmed's avatar Mustaq Ahmed Committed by Commit Bot

Remove unused plugin code triggering synthetic user activation.

Bug: 848778
Change-Id: If8b8f9e8ee29ac3d7acae751e2d062a7e838bf40
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2507512Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Commit-Queue: Mustaq Ahmed <mustaq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#822879}
parent cf846aaa
......@@ -24,9 +24,8 @@ enum UserActivationNotificationType {
// An extension API caused the notification call through GuestView.
kExtensionGuestView,
// An extension messaging API caused the notification call. This enum value
// is deprecated by more specific enums kExtensionMessaging* below, we are
// preserving this enum value only for UMA consistency.
// An extension messaging API caused the notification call. Deprecated,
// preserved only for UMA consistency. See more specific enums below.
kExtensionMessaging,
// A media API caused the notification call.
......@@ -35,7 +34,8 @@ enum UserActivationNotificationType {
// An NFS API caused the notification call.
kNativeFileSystem,
// A plugin API caused the notification call.
// A plugin API caused the notification call. Deprecated, preserved only for
// UMA consistency.
kPlugin,
// A test API caused the notification call. This should not affect
......
......@@ -46,7 +46,6 @@ class WebDocument;
class WebElement;
class WebPlugin;
class WebString;
class WebURL;
class WebURLRequest;
class WebDOMMessageEvent;
struct WebRect;
......@@ -92,11 +91,6 @@ class WebPluginContainer {
// containing the plugin as a native v8 object.
virtual v8::Local<v8::Object> V8ObjectForElement() = 0;
// Executes a "javascript:" URL on behalf of the plugin in the context
// of the frame containing the plugin. Returns the result of script
// execution, if any.
virtual WebString ExecuteScriptURL(const WebURL&, bool popups_allowed) = 0;
// Loads an URL in the specified frame (or the frame containing this
// plugin if target is empty). If notifyNeeded is true, then upon
// completion, WebPlugin::didFinishLoadingFrameRequest is called if the
......
......@@ -38,7 +38,6 @@
#include "third_party/blink/public/platform/web_drag_data.h"
#include "third_party/blink/public/platform/web_rect.h"
#include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/public/platform/web_url.h"
#include "third_party/blink/public/platform/web_url_error.h"
#include "third_party/blink/public/platform/web_url_request.h"
#include "third_party/blink/public/web/web_document.h"
......@@ -584,45 +583,6 @@ v8::Local<v8::Object> WebPluginContainerImpl::V8ObjectForElement() {
return v8::Local<v8::Object>::Cast(v8value);
}
// TODO(hiroshige): Consider merging with LocalFrame::ExecuteJavaScriptURL().
WebString WebPluginContainerImpl::ExecuteScriptURL(const WebURL& url,
bool popups_allowed) {
LocalDOMWindow* window = element_->GetDocument().domWindow();
if (!window)
return WebString();
const KURL& kurl = url;
DCHECK(kurl.ProtocolIs("javascript"));
String script = DecodeURLEscapeSequences(kurl.GetString(),
DecodeURLMode::kUTF8OrIsomorphic);
if (!element_->GetExecutionContext()->GetContentSecurityPolicy()->AllowInline(
ContentSecurityPolicy::InlineType::kNavigation, element_, script,
String() /* nonce */, element_->GetDocument().Url(),
OrdinalNumber())) {
return WebString();
}
script = script.Substring(strlen("javascript:"));
if (popups_allowed) {
LocalFrame::NotifyUserActivation(
window->GetFrame(),
mojom::blink::UserActivationNotificationType::kPlugin);
}
v8::HandleScope handle_scope(window->GetIsolate());
v8::Local<v8::Value> result =
ClassicScript::CreateUnspecifiedScript(
ScriptSourceCode(script, ScriptSourceLocationType::kJavascriptUrl))
->RunScriptAndReturnValue(window);
// Failure is reported as a null string.
if (result.IsEmpty() || !result->IsString())
return WebString();
return ToCoreString(v8::Local<v8::String>::Cast(result));
}
void WebPluginContainerImpl::LoadFrameRequest(const WebURLRequest& request,
const WebString& target) {
LocalDOMWindow* window = element_->GetDocument().domWindow();
......
......@@ -126,7 +126,6 @@ class CORE_EXPORT WebPluginContainerImpl final
void ScheduleAnimation() override;
void ReportGeometry() override;
v8::Local<v8::Object> V8ObjectForElement() override;
WebString ExecuteScriptURL(const WebURL&, bool popups_allowed) override;
void LoadFrameRequest(const WebURLRequest&, const WebString& target) override;
bool IsRectTopmost(const WebRect&) override;
void RequestTouchEventType(TouchEventRequestType) override;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment