#include "components/plugins/renderer/webview_plugin.h"
#include <stddef.h>
#include <memory>
#include <string>
#include "base/auto_reset.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/location.h"
#include "base/metrics/histogram_macros.h"
#include "base/numerics/safe_conversions.h"
#include "base/task/single_thread_task_runner.h"
#include "gin/converter.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "skia/ext/platform_canvas.h"
#include "third_party/blink/public/common/input/web_coalesced_input_event.h"
#include "third_party/blink/public/common/page/browsing_context_group_info.h"
#include "third_party/blink/public/common/page/page_zoom.h"
#include "third_party/blink/public/common/tokens/tokens.h"
#include "third_party/blink/public/common/web_preferences/web_preferences.h"
#include "third_party/blink/public/mojom/input/focus_type.mojom.h"
#include "third_party/blink/public/mojom/page/prerender_page_param.mojom.h"
#include "third_party/blink/public/mojom/partitioned_popins/partitioned_popin_params.mojom.h"
#include "third_party/blink/public/platform/scheduler/web_agent_group_scheduler.h"
#include "third_party/blink/public/platform/scheduler/web_thread_scheduler.h"
#include "third_party/blink/public/platform/web_policy_container.h"
#include "third_party/blink/public/platform/web_url.h"
#include "third_party/blink/public/platform/web_url_response.h"
#include "third_party/blink/public/web/web_document.h"
#include "third_party/blink/public/web/web_element.h"
#include "third_party/blink/public/web/web_frame_widget.h"
#include "third_party/blink/public/web/web_local_frame.h"
#include "third_party/blink/public/web/web_navigation_control.h"
#include "third_party/blink/public/web/web_plugin_container.h"
#include "third_party/blink/public/web/web_view.h"
DragOperationsMask;
WebDragData;
WebFrameWidget;
WebLocalFrame;
WebMouseEvent;
WebPlugin;
WebPluginContainer;
WebString;
WebURLError;
WebURLResponse;
WebVector;
WebView;
WebPreferences;
WebViewPlugin::WebViewPlugin(WebView* web_view,
WebViewPlugin::Delegate* delegate,
const WebPreferences& preferences)
: … { … }
WebViewPlugin* WebViewPlugin::Create(WebView* web_view,
WebViewPlugin::Delegate* delegate,
const WebPreferences& preferences,
const std::string& html_data,
const GURL& url) { … }
WebViewPlugin::~WebViewPlugin() { … }
void WebViewPlugin::ReplayReceivedData(WebPlugin* plugin) { … }
WebPluginContainer* WebViewPlugin::Container() const { … }
bool WebViewPlugin::Initialize(WebPluginContainer* container) { … }
void WebViewPlugin::Destroy() { … }
v8::Local<v8::Object> WebViewPlugin::V8ScriptableObject(v8::Isolate* isolate) { … }
void WebViewPlugin::UpdateAllLifecyclePhases(
blink::DocumentUpdateReason reason) { … }
bool WebViewPlugin::IsErrorPlaceholder() { … }
void WebViewPlugin::Paint(cc::PaintCanvas* canvas, const gfx::Rect& rect) { … }
void WebViewPlugin::UpdateGeometry(const gfx::Rect& window_rect,
const gfx::Rect& clip_rect,
const gfx::Rect& unobscured_rect,
bool is_visible) { … }
void WebViewPlugin::UpdateFocus(bool focused,
blink::mojom::FocusType focus_type) { … }
blink::WebInputEventResult WebViewPlugin::HandleInputEvent(
const blink::WebCoalescedInputEvent& coalesced_event,
ui::Cursor* cursor) { … }
void WebViewPlugin::DidReceiveResponse(const WebURLResponse& response) { … }
void WebViewPlugin::DidReceiveData(const char* data, size_t data_length) { … }
void WebViewPlugin::DidFinishLoading() { … }
void WebViewPlugin::DidFailLoading(const WebURLError& error) { … }
WebViewPlugin::WebViewHelper::WebViewHelper(
WebViewPlugin* plugin,
const WebPreferences& parent_web_preferences,
const blink::RendererPreferences& parent_renderer_preferences)
: … { … }
WebViewPlugin::WebViewHelper::~WebViewHelper() { … }
void WebViewPlugin::WebViewHelper::UpdateTooltipUnderCursor(
const std::u16string& tooltip_text,
base::i18n::TextDirection hint) { … }
void WebViewPlugin::WebViewHelper::UpdateTooltipFromKeyboard(
const std::u16string& tooltip_text,
base::i18n::TextDirection hint,
const gfx::Rect& bounds) { … }
void WebViewPlugin::WebViewHelper::ClearKeyboardTriggeredTooltip() { … }
void WebViewPlugin::WebViewHelper::UpdateTooltip(
const std::u16string& tooltip_text) { … }
void WebViewPlugin::WebViewHelper::InvalidateContainer() { … }
void WebViewPlugin::WebViewHelper::SetCursor(const ui::Cursor& cursor) { … }
void WebViewPlugin::WebViewHelper::ScheduleNonCompositedAnimation() { … }
scoped_refptr<network::SharedURLLoaderFactory>
WebViewPlugin::WebViewHelper::GetURLLoaderFactory() { … }
void WebViewPlugin::WebViewHelper::BindToFrame(
blink::WebNavigationControl* frame) { … }
void WebViewPlugin::WebViewHelper::DidClearWindowObject() { … }
void WebViewPlugin::WebViewHelper::FrameDetached() { … }
void WebViewPlugin::OnZoomLevelChanged() { … }
void WebViewPlugin::LoadHTML(const std::string& html_data, const GURL& url) { … }
void WebViewPlugin::UpdatePluginForNewGeometry(
const gfx::Rect& window_rect,
const gfx::Rect& unobscured_rect) { … }
scoped_refptr<base::SingleThreadTaskRunner> WebViewPlugin::GetTaskRunner() { … }