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

/*
 * Copyright (C) 2012 Google Inc. 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_page_popup_impl.h"

#include <memory>

#include "cc/animation/animation_host.h"
#include "cc/animation/animation_timeline.h"
#include "cc/base/features.h"
#include "cc/layers/picture_layer.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "third_party/blink/public/common/storage_key/storage_key.h"
#include "third_party/blink/public/common/tokens/tokens.h"
#include "third_party/blink/public/mojom/input/input_handler.mojom-blink.h"
#include "third_party/blink/public/web/web_view_client.h"
#include "third_party/blink/renderer/core/accessibility/ax_object_cache_base.h"
#include "third_party/blink/renderer/core/css/media_feature_overrides.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/events/event_dispatch_forbidden_scope.h"
#include "third_party/blink/renderer/core/dom/node_computed_style.h"
#include "third_party/blink/renderer/core/events/message_event.h"
#include "third_party/blink/renderer/core/events/web_input_event_conversion.h"
#include "third_party/blink/renderer/core/exported/web_settings_impl.h"
#include "third_party/blink/renderer/core/exported/web_view_impl.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_client.h"
#include "third_party/blink/renderer/core/frame/local_frame_ukm_aggregator.h"
#include "third_party/blink/renderer/core/frame/local_frame_view.h"
#include "third_party/blink/renderer/core/frame/screen_metrics_emulator.h"
#include "third_party/blink/renderer/core/frame/settings.h"
#include "third_party/blink/renderer/core/frame/visual_viewport.h"
#include "third_party/blink/renderer/core/frame/web_frame_widget_impl.h"
#include "third_party/blink/renderer/core/frame/web_local_frame_impl.h"
#include "third_party/blink/renderer/core/geometry/dom_rect.h"
#include "third_party/blink/renderer/core/input/event_handler.h"
#include "third_party/blink/renderer/core/layout/layout_view.h"
#include "third_party/blink/renderer/core/loader/empty_clients.h"
#include "third_party/blink/renderer/core/loader/frame_load_request.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/page_animator.h"
#include "third_party/blink/renderer/core/page/page_popup_client.h"
#include "third_party/blink/renderer/core/page/page_popup_controller.h"
#include "third_party/blink/renderer/platform/bindings/script_forbidden_scope.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/instrumentation/tracing/trace_event.h"
#include "third_party/blink/renderer/platform/instrumentation/use_counter.h"
#include "third_party/blink/renderer/platform/keyboard_codes.h"
#include "third_party/blink/renderer/platform/scheduler/public/agent_group_scheduler.h"
#include "third_party/blink/renderer/platform/scheduler/public/thread.h"
#include "third_party/blink/renderer/platform/text/text_direction.h"
#include "third_party/blink/renderer/platform/web_test_support.h"
#include "third_party/blink/renderer/platform/widget/frame_widget.h"
#include "third_party/blink/renderer/platform/widget/input/input_metrics.h"
#include "third_party/blink/renderer/platform/widget/input/widget_input_handler_manager.h"
#include "third_party/blink/renderer/platform/widget/widget_base.h"

namespace blink {
namespace {
ScrollableArea* ToScrollableArea(Node* node) {}

bool CanScroll(Node* node) {}

Node* FindFirstScroller(Node* event_target) {}

Page* CreatePage(ChromeClient& chrome_client, WebViewImpl& opener_web_view) {}

}  // namespace

class PagePopupChromeClient final : public EmptyChromeClient {};

// WebPagePopupImpl ----------------------------------------------------------

WebPagePopupImpl::WebPagePopupImpl(
    CrossVariantMojoAssociatedRemote<mojom::blink::PopupWidgetHostInterfaceBase>
        popup_widget_host,
    CrossVariantMojoAssociatedRemote<mojom::blink::WidgetHostInterfaceBase>
        widget_host,
    CrossVariantMojoAssociatedReceiver<mojom::blink::WidgetInterfaceBase>
        widget,
    WebViewImpl* opener_web_view,
    AgentGroupScheduler& agent_group_scheduler,
    const display::ScreenInfos& screen_infos,
    PagePopupClient* popup_client)
    :{}

WebPagePopupImpl::~WebPagePopupImpl() {}

void WebPagePopupImpl::DidShowPopup() {}

void WebPagePopupImpl::DidSetBounds() {}

void WebPagePopupImpl::InitializeCompositing(
    const display::ScreenInfos& screen_infos,
    const cc::LayerTreeSettings* settings) {}

void WebPagePopupImpl::SetCursor(const ui::Cursor& cursor) {}

bool WebPagePopupImpl::HandlingInputEvent() {}

void WebPagePopupImpl::SetHandlingInputEvent(bool handling) {}

void WebPagePopupImpl::ProcessInputEventSynchronouslyForTesting(
    const WebCoalescedInputEvent& event) {}

void WebPagePopupImpl::DispatchNonBlockingEventForTesting(
    std::unique_ptr<WebCoalescedInputEvent> event) {}

void WebPagePopupImpl::UpdateTextInputState() {}

void WebPagePopupImpl::UpdateSelectionBounds() {}

void WebPagePopupImpl::ShowVirtualKeyboard() {}

void WebPagePopupImpl::SetFocus(bool focus) {}

bool WebPagePopupImpl::HasFocus() {}

void WebPagePopupImpl::FlushInputProcessedCallback() {}

void WebPagePopupImpl::CancelCompositionForPepper() {}

void WebPagePopupImpl::ApplyVisualProperties(
    const VisualProperties& visual_properties) {}

const display::ScreenInfo& WebPagePopupImpl::GetScreenInfo() {}

const display::ScreenInfos& WebPagePopupImpl::GetScreenInfos() {}

const display::ScreenInfo& WebPagePopupImpl::GetOriginalScreenInfo() {}

const display::ScreenInfos& WebPagePopupImpl::GetOriginalScreenInfos() {}

gfx::Rect WebPagePopupImpl::WindowRect() {}

gfx::Rect WebPagePopupImpl::ViewRect() {}

void WebPagePopupImpl::SetScreenRects(const gfx::Rect& widget_screen_rect,
                                      const gfx::Rect& window_screen_rect) {}

gfx::Size WebPagePopupImpl::VisibleViewportSizeInDIPs() {}

bool WebPagePopupImpl::IsHidden() const {}

void WebPagePopupImpl::SetCompositorVisible(bool visible) {}

void WebPagePopupImpl::WarmUpCompositor() {}

void WebPagePopupImpl::PostMessageToPopup(const String& message) {}

void WebPagePopupImpl::Update() {}

void WebPagePopupImpl::DestroyPage() {}

AXObject* WebPagePopupImpl::RootAXObject(Element* popup_owner) {}

void WebPagePopupImpl::SetWindowRect(const gfx::Rect& rect_in_screen) {}

void WebPagePopupImpl::SetRootLayer(scoped_refptr<cc::Layer> layer) {}

void WebPagePopupImpl::SetSuppressFrameRequestsWorkaroundFor704763Only(
    bool suppress_frame_requests) {}

void WebPagePopupImpl::UpdateLifecycle(WebLifecycleUpdate requested_update,
                                       DocumentUpdateReason reason) {}

void WebPagePopupImpl::Resize(const gfx::Size& new_size_in_viewport) {}

WebInputEventResult WebPagePopupImpl::HandleKeyEvent(
    const WebKeyboardEvent& event) {}

cc::LayerTreeHost* WebPagePopupImpl::LayerTreeHostForTesting() {}

void WebPagePopupImpl::OnCommitRequested() {}

void WebPagePopupImpl::BeginMainFrame(base::TimeTicks last_frame_time) {}

void WebPagePopupImpl::WillHandleGestureEvent(const WebGestureEvent& event,
                                              bool* suppress) {}

void WebPagePopupImpl::WillHandleMouseEvent(const WebMouseEvent& event) {}

void WebPagePopupImpl::ObserveGestureEventAndResult(
    const WebGestureEvent& gesture_event,
    const gfx::Vector2dF& unused_delta,
    const cc::OverscrollBehavior& overscroll_behavior,
    bool event_processed) {}

WebInputEventResult WebPagePopupImpl::HandleCharEvent(
    const WebKeyboardEvent& event) {}

WebInputEventResult WebPagePopupImpl::HandleGestureEvent(
    const WebGestureEvent& event) {}

void WebPagePopupImpl::HandleMouseDown(LocalFrame& main_frame,
                                       const WebMouseEvent& event) {}

WebInputEventResult WebPagePopupImpl::HandleMouseWheel(
    LocalFrame& main_frame,
    const WebMouseWheelEvent& event) {}

LocalFrame& WebPagePopupImpl::MainFrame() const {}

Element* WebPagePopupImpl::FocusedElement() const {}

bool WebPagePopupImpl::IsViewportPointInWindow(int x, int y) {}

bool WebPagePopupImpl::ShouldCheckPopupPositionForTelemetry() const {}

void WebPagePopupImpl::CheckScreenPointInOwnerWindowAndCount(
    const gfx::PointF& point_in_screen,
    WebFeature feature) const {}

gfx::Rect WebPagePopupImpl::OwnerWindowRectInScreen() const {}

gfx::Rect WebPagePopupImpl::GetAnchorRectInScreen() const {}

WebInputEventResult WebPagePopupImpl::DispatchBufferedTouchEvents() {}

WebInputEventResult WebPagePopupImpl::HandleInputEvent(
    const WebCoalescedInputEvent& event) {}

void WebPagePopupImpl::FocusChanged(mojom::blink::FocusState focus_state) {}

void WebPagePopupImpl::ScheduleAnimation() {}

void WebPagePopupImpl::UpdateVisualProperties(
    const VisualProperties& visual_properties) {}

gfx::Rect WebPagePopupImpl::ViewportVisibleRect() {}

KURL WebPagePopupImpl::GetURLForDebugTrace() {}

void WebPagePopupImpl::WidgetHostDisconnected() {}

void WebPagePopupImpl::Close() {}

void WebPagePopupImpl::ClosePopup() {}

LocalDOMWindow* WebPagePopupImpl::Window() {}

WebDocument WebPagePopupImpl::GetDocument() {}

void WebPagePopupImpl::Cancel() {}

gfx::Rect WebPagePopupImpl::WindowRectInScreen() const {}

void WebPagePopupImpl::InjectScrollbarGestureScroll(
    const gfx::Vector2dF& delta,
    ui::ScrollGranularity granularity,
    cc::ElementId scrollable_area_element_id,
    WebInputEvent::Type injected_type) {}

void WebPagePopupImpl::ScreenRectToEmulated(gfx::Rect& screen_rect) {}

void WebPagePopupImpl::EmulatedToScreenRect(gfx::Rect& screen_rect) {}

std::unique_ptr<cc::LayerTreeFrameSink>
WebPagePopupImpl::AllocateNewLayerTreeFrameSink() {}

// WebPagePopup ----------------------------------------------------------------

WebPagePopupImpl* WebPagePopupImpl::Create(
    CrossVariantMojoAssociatedRemote<mojom::blink::PopupWidgetHostInterfaceBase>
        popup_widget_host,
    CrossVariantMojoAssociatedRemote<mojom::blink::WidgetHostInterfaceBase>
        widget_host,
    CrossVariantMojoAssociatedReceiver<mojom::blink::WidgetInterfaceBase>
        widget,
    WebViewImpl* opener_webview,
    AgentGroupScheduler& agent_group_scheduler,
    const display::ScreenInfos& screen_infos,
    PagePopupClient* popup_client) {}

}  // namespace blink