chromium/third_party/blink/renderer/core/exported/web_plugin_container_impl.cc

/*
 * Copyright (C) 2009 Google Inc. All rights reserved.
 * Copyright (C) 2014 Opera Software ASA. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 *
 *     * Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above
 * copyright notice, this list of conditions and the following disclaimer
 * in the documentation and/or other materials provided with the
 * distribution.
 *     * Neither the name of Google Inc. nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#include "third_party/blink/renderer/core/exported/web_plugin_container_impl.h"

#include "build/build_config.h"
#include "third_party/blink/public/common/input/web_coalesced_input_event.h"
#include "third_party/blink/public/common/input/web_input_event.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/public/platform/web_drag_data.h"
#include "third_party/blink/public/platform/web_string.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"
#include "third_party/blink/public/web/web_dom_message_event.h"
#include "third_party/blink/public/web/web_element.h"
#include "third_party/blink/public/web/web_local_frame.h"
#include "third_party/blink/public/web/web_local_frame_client.h"
#include "third_party/blink/public/web/web_plugin.h"
#include "third_party/blink/public/web/web_print_params.h"
#include "third_party/blink/public/web/web_print_preset_options.h"
#include "third_party/blink/public/web/web_view_client.h"
#include "third_party/blink/renderer/bindings/core/v8/sanitize_script_errors.h"
#include "third_party/blink/renderer/bindings/core/v8/to_v8_traits.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_element.h"
#include "third_party/blink/renderer/core/clipboard/clipboard_utilities.h"
#include "third_party/blink/renderer/core/clipboard/data_object.h"
#include "third_party/blink/renderer/core/clipboard/data_transfer.h"
#include "third_party/blink/renderer/core/clipboard/system_clipboard.h"
#include "third_party/blink/renderer/core/dom/dom_node_ids.h"
#include "third_party/blink/renderer/core/dom/events/native_event_listener.h"
#include "third_party/blink/renderer/core/events/drag_event.h"
#include "third_party/blink/renderer/core/events/gesture_event.h"
#include "third_party/blink/renderer/core/events/keyboard_event.h"
#include "third_party/blink/renderer/core/events/mouse_event.h"
#include "third_party/blink/renderer/core/events/progress_event.h"
#include "third_party/blink/renderer/core/events/resource_progress_event.h"
#include "third_party/blink/renderer/core/events/touch_event.h"
#include "third_party/blink/renderer/core/events/web_input_event_conversion.h"
#include "third_party/blink/renderer/core/events/wheel_event.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/exported/web_view_impl.h"
#include "third_party/blink/renderer/core/frame/csp/content_security_policy.h"
#include "third_party/blink/renderer/core/frame/event_handler_registry.h"
#include "third_party/blink/renderer/core/frame/find_in_page.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/local_frame_view.h"
#include "third_party/blink/renderer/core/frame/web_local_frame_impl.h"
#include "third_party/blink/renderer/core/fullscreen/fullscreen.h"
#include "third_party/blink/renderer/core/html/forms/html_form_element.h"
#include "third_party/blink/renderer/core/html/html_plugin_element.h"
#include "third_party/blink/renderer/core/html_names.h"
#include "third_party/blink/renderer/core/input/event_handler.h"
#include "third_party/blink/renderer/core/layout/hit_test_result.h"
#include "third_party/blink/renderer/core/layout/layout_box.h"
#include "third_party/blink/renderer/core/layout/layout_embedded_content.h"
#include "third_party/blink/renderer/core/layout/layout_view.h"
#include "third_party/blink/renderer/core/loader/frame_load_request.h"
#include "third_party/blink/renderer/core/page/chrome_client.h"
#include "third_party/blink/renderer/core/page/focus_controller.h"
#include "third_party/blink/renderer/core/page/page.h"
#include "third_party/blink/renderer/core/page/pointer_lock_controller.h"
#include "third_party/blink/renderer/core/paint/paint_layer.h"
#include "third_party/blink/renderer/core/script/classic_script.h"
#include "third_party/blink/renderer/core/scroll/scroll_animator_base.h"
#include "third_party/blink/renderer/core/scroll/scrollbar_theme.h"
#include "third_party/blink/renderer/platform/bindings/script_forbidden_scope.h"
#include "third_party/blink/renderer/platform/exported/wrapped_resource_response.h"
#include "third_party/blink/renderer/platform/graphics/graphics_context.h"
#include "third_party/blink/renderer/platform/graphics/paint/cull_rect.h"
#include "third_party/blink/renderer/platform/graphics/paint/drawing_recorder.h"
#include "third_party/blink/renderer/platform/graphics/paint/foreign_layer_display_item.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/keyboard_codes.h"
#include "third_party/blink/renderer/platform/weborigin/kurl.h"
#include "ui/base/cursor/cursor.h"
#include "ui/base/cursor/mojom/cursor_type.mojom-blink.h"

namespace blink {

namespace {

#if BUILDFLAG(IS_MAC)
const WebInputEvent::Modifiers kEditingModifier = WebInputEvent::kMetaKey;
#else
const WebInputEvent::Modifiers kEditingModifier =;
#endif

}  // namespace

class WebPluginContainerImpl::MouseLockLostListener final
    : public NativeEventListener {};

// Public methods --------------------------------------------------------------

void WebPluginContainerImpl::AttachToLayout() {}

void WebPluginContainerImpl::DetachFromLayout() {}

void WebPluginContainerImpl::UpdateAllLifecyclePhases() {}

void WebPluginContainerImpl::Paint(GraphicsContext& context,
                                   PaintFlags,
                                   const CullRect& cull_rect,
                                   const gfx::Vector2d& paint_offset) const {}

void WebPluginContainerImpl::UpdateGeometry() {}

void WebPluginContainerImpl::Invalidate() {}

void WebPluginContainerImpl::SetFocused(bool focused,
                                        mojom::blink::FocusType focus_type) {}

bool WebPluginContainerImpl::IsErrorplaceholder() {}

void WebPluginContainerImpl::Show() {}

void WebPluginContainerImpl::Hide() {}

void WebPluginContainerImpl::HandleEvent(Event& event) {}

void WebPluginContainerImpl::EventListenersRemoved() {}

void WebPluginContainerImpl::ParentVisibleChanged() {}

void WebPluginContainerImpl::SetPlugin(WebPlugin* plugin) {}

void WebPluginContainerImpl::UsePluginAsFindHandler() {}

void WebPluginContainerImpl::ReportFindInPageMatchCount(int identifier,
                                                        int total,
                                                        bool final_update) {}

void WebPluginContainerImpl::ReportFindInPageSelection(int identifier,
                                                       int index,
                                                       bool final_update) {}

float WebPluginContainerImpl::PageScaleFactor() {}

float WebPluginContainerImpl::LayoutZoomFactor() {}

void WebPluginContainerImpl::SetCcLayer(cc::Layer* new_layer) {}

void WebPluginContainerImpl::RequestFullscreen() {}

bool WebPluginContainerImpl::IsFullscreenElement() const {}

void WebPluginContainerImpl::CancelFullscreen() {}

bool WebPluginContainerImpl::IsMouseLocked() {}

bool WebPluginContainerImpl::LockMouse(bool request_unadjusted_movement) {}

void WebPluginContainerImpl::UnlockMouse() {}

void WebPluginContainerImpl::HandleLockMouseResult(
    mojom::blink::PointerLockResult result) {}

void WebPluginContainerImpl::MaybeLostMouseLock() {}

bool WebPluginContainerImpl::SupportsPaginatedPrint() const {}

bool WebPluginContainerImpl::GetPrintPresetOptionsFromDocument(
    WebPrintPresetOptions* preset_options) const {}

int WebPluginContainerImpl::PrintBegin(
    const WebPrintParams& print_params) const {}

void WebPluginContainerImpl::PrintPage(int page_index, GraphicsContext& gc) {}

void WebPluginContainerImpl::PrintEnd() {}

void WebPluginContainerImpl::Copy() {}

bool WebPluginContainerImpl::ExecuteEditCommand(const WebString& name) {}

bool WebPluginContainerImpl::ExecuteEditCommand(const WebString& name,
                                                const WebString& value) {}

// static
bool WebPluginContainerImpl::SupportsCommand(const WebString& name) {}

WebElement WebPluginContainerImpl::GetElement() {}

WebDocument WebPluginContainerImpl::GetDocument() {}

void WebPluginContainerImpl::DispatchProgressEvent(const WebString& type,
                                                   bool length_computable,
                                                   uint64_t loaded,
                                                   uint64_t total,
                                                   const WebString& url) {}

void WebPluginContainerImpl::EnqueueMessageEvent(
    const WebDOMMessageEvent& event) {}

void WebPluginContainerImpl::ScheduleAnimation() {}

void WebPluginContainerImpl::ReportGeometry() {}

v8::Local<v8::Object> WebPluginContainerImpl::V8ObjectForElement() {}

void WebPluginContainerImpl::LoadFrameRequest(const WebURLRequest& request,
                                              const WebString& target) {}

bool WebPluginContainerImpl::IsRectTopmost(const gfx::Rect& rect) {}

void WebPluginContainerImpl::RequestTouchEventType(
    TouchEventRequestType request_type) {}

void WebPluginContainerImpl::SetWantsWheelEvents(bool wants_wheel_events) {}

gfx::Point WebPluginContainerImpl::RootFrameToLocalPoint(
    const gfx::Point& point_in_root_frame) {}

gfx::Point WebPluginContainerImpl::LocalToRootFramePoint(
    const gfx::Point& point_in_local) {}

bool WebPluginContainerImpl::WasTargetForLastMouseEvent() {}

void WebPluginContainerImpl::DidReceiveResponse(
    const ResourceResponse& response) {}

void WebPluginContainerImpl::DidReceiveData(const char* data,
                                            size_t data_length) {}

void WebPluginContainerImpl::DidFinishLoading() {}

void WebPluginContainerImpl::DidFailLoading(const ResourceError& error) {}

cc::Layer* WebPluginContainerImpl::CcLayer() const {}

v8::Local<v8::Object> WebPluginContainerImpl::ScriptableObject(
    v8::Isolate* isolate) {}

bool WebPluginContainerImpl::SupportsKeyboardFocus() const {}

bool WebPluginContainerImpl::SupportsInputMethod() const {}

bool WebPluginContainerImpl::CanProcessDrag() const {}

bool WebPluginContainerImpl::WantsWheelEvents() const {}

// Private methods -------------------------------------------------------------

WebPluginContainerImpl::WebPluginContainerImpl(HTMLPlugInElement& element,
                                               WebPlugin* web_plugin)
    :{}

WebPluginContainerImpl::~WebPluginContainerImpl() {}

LocalFrameView* WebPluginContainerImpl::ParentFrameView() const {}

LayoutEmbeddedContent* WebPluginContainerImpl::GetLayoutEmbeddedContent()
    const {}

void WebPluginContainerImpl::Dispose() {}

void WebPluginContainerImpl::SetFrameRect(const gfx::Rect& rect) {}

void WebPluginContainerImpl::Trace(Visitor* visitor) const {}

void WebPluginContainerImpl::HandleMouseEvent(MouseEvent& event) {}

void WebPluginContainerImpl::HandleDragEvent(MouseEvent& event) {}

void WebPluginContainerImpl::HandleWheelEvent(WheelEvent& event) {}

void WebPluginContainerImpl::HandleKeyboardEvent(KeyboardEvent& event) {}

bool WebPluginContainerImpl::HandleCutCopyPasteKeyboardEvent(
    const WebKeyboardEvent& event) {}

WebTouchEvent WebPluginContainerImpl::TransformTouchEvent(
    const WebInputEvent& event) {}

WebCoalescedInputEvent WebPluginContainerImpl::TransformCoalescedTouchEvent(
    const WebCoalescedInputEvent& coalesced_event) {}

void WebPluginContainerImpl::HandleTouchEvent(TouchEvent& event) {}

void WebPluginContainerImpl::HandleGestureEvent(GestureEvent& event) {}

void WebPluginContainerImpl::SynthesizeMouseEventIfPossible(TouchEvent& event) {}

void WebPluginContainerImpl::FocusPlugin() {}

void WebPluginContainerImpl::ComputeClipRectsForPlugin(
    const HTMLFrameOwnerElement* owner_element,
    gfx::Rect& window_rect,
    gfx::Rect& clipped_local_rect,
    gfx::Rect& unclipped_int_local_rect) const {}

void WebPluginContainerImpl::CalculateGeometry(gfx::Rect& window_rect,
                                               gfx::Rect& clip_rect,
                                               gfx::Rect& unobscured_rect) {}

}  // namespace blink