chromium/ui/views/controls/webview/web_dialog_view.cc

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ui/views/controls/webview/web_dialog_view.h"

#include <utility>
#include <vector>

#include "base/strings/utf_string_conversions.h"
#include "components/input/native_web_keyboard_event.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents.h"
#include "third_party/blink/public/mojom/loader/resource_load_info.mojom.h"
#include "ui/base/interaction/element_identifier.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/events/event.h"
#include "ui/events/keycodes/keyboard_codes.h"
#include "ui/gfx/geometry/rounded_corners_f.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/views/controls/webview/webview.h"
#include "ui/views/layout/fill_layout.h"
#include "ui/views/view_class_properties.h"
#include "ui/views/widget/native_widget_private.h"
#include "ui/views/widget/root_view.h"
#include "ui/views/widget/widget.h"
#include "ui/views/window/dialog_delegate.h"
#include "ui/web_dialogs/web_dialog_delegate.h"
#include "ui/web_dialogs/web_dialog_ui.h"

WebContents;
WebUIMessageHandler;
NativeWebKeyboardEvent;
WebDialogDelegate;
WebDialogUIBase;
WebDialogWebContentsDelegate;

namespace views {

ObservableWebView::ObservableWebView(content::BrowserContext* browser_context,
                                     WebDialogDelegate* delegate)
    :{}

ObservableWebView::~ObservableWebView() = default;

void ObservableWebView::DidFinishLoad(
    content::RenderFrameHost* render_frame_host,
    const GURL& validated_url) {}

void ObservableWebView::ResetDelegate() {}

BEGIN_METADATA()

////////////////////////////////////////////////////////////////////////////////
// WebDialogView, public:

WebDialogView::WebDialogView(content::BrowserContext* context,
                             WebDialogDelegate* delegate,
                             std::unique_ptr<WebContentsHandler> handler,
                             content::WebContents* web_contents)
    :{}

WebDialogView::~WebDialogView() = default;

content::WebContents* WebDialogView::web_contents() {}

////////////////////////////////////////////////////////////////////////////////
// WebDialogView, views::View implementation:

void WebDialogView::AddedToWidget() {}

gfx::Size WebDialogView::CalculatePreferredSize(
    const SizeBounds& available_size) const {}

gfx::Size WebDialogView::GetMinimumSize() const {}

bool WebDialogView::AcceleratorPressed(const ui::Accelerator& accelerator) {}

void WebDialogView::ViewHierarchyChanged(
    const ViewHierarchyChangedDetails& details) {}

views::CloseRequestResult WebDialogView::OnWindowCloseRequested() {}

////////////////////////////////////////////////////////////////////////////////
// WebDialogView, views::WidgetDelegate implementation:

bool WebDialogView::CanMaximize() const {}

std::u16string WebDialogView::GetWindowTitle() const {}

std::u16string WebDialogView::GetAccessibleWindowTitle() const {}

std::string WebDialogView::GetWindowName() const {}

void WebDialogView::WindowClosing() {}

views::View* WebDialogView::GetContentsView() {}

views::ClientView* WebDialogView::CreateClientView(views::Widget* widget) {}

std::unique_ptr<NonClientFrameView> WebDialogView::CreateNonClientFrameView(
    Widget* widget) {}

views::View* WebDialogView::GetInitiallyFocusedView() {}

bool WebDialogView::ShouldShowWindowTitle() const {}

views::Widget* WebDialogView::GetWidget() {}

const views::Widget* WebDialogView::GetWidget() const {}

////////////////////////////////////////////////////////////////////////////////
// WebDialogDelegate implementation:

ui::mojom::ModalType WebDialogView::GetDialogModalType() const {}

std::u16string WebDialogView::GetDialogTitle() const {}

GURL WebDialogView::GetDialogContentURL() const {}

void WebDialogView::GetWebUIMessageHandlers(
    std::vector<WebUIMessageHandler*>* handlers) {}

void WebDialogView::GetDialogSize(gfx::Size* size) const {}

void WebDialogView::GetMinimumDialogSize(gfx::Size* size) const {}

std::string WebDialogView::GetDialogArgs() const {}

void WebDialogView::OnDialogShown(content::WebUI* webui) {}

void WebDialogView::OnDialogClosed(const std::string& json_retval) {}

void WebDialogView::OnDialogCloseFromWebUI(const std::string& json_retval) {}

void WebDialogView::OnCloseContents(WebContents* source,
                                    bool* out_close_dialog) {}

bool WebDialogView::ShouldShowDialogTitle() const {}

bool WebDialogView::ShouldCenterDialogTitleText() const {}

bool WebDialogView::ShouldShowCloseButton() const {}

bool WebDialogView::HandleContextMenu(
    content::RenderFrameHost& render_frame_host,
    const content::ContextMenuParams& params) {}

WebDialogView::FrameKind WebDialogView::GetWebDialogFrameKind() const {}

////////////////////////////////////////////////////////////////////////////////
// content::WebContentsDelegate implementation:

void WebDialogView::SetContentsBounds(WebContents* source,
                                      const gfx::Rect& bounds) {}

// A simplified version of BrowserView::HandleKeyboardEvent().
// We don't handle global keyboard shortcuts here, but that's fine since
// they're all browser-specific. (This may change in the future.)
bool WebDialogView::HandleKeyboardEvent(
    content::WebContents* source,
    const input::NativeWebKeyboardEvent& event) {}

void WebDialogView::CloseContents(WebContents* source) {}

content::WebContents* WebDialogView::OpenURLFromTab(
    content::WebContents* source,
    const content::OpenURLParams& params,
    base::OnceCallback<void(content::NavigationHandle&)>
        navigation_handle_callback) {}

content::WebContents* WebDialogView::AddNewContents(
    content::WebContents* source,
    std::unique_ptr<content::WebContents> new_contents,
    const GURL& target_url,
    WindowOpenDisposition disposition,
    const blink::mojom::WindowFeatures& window_features,
    bool user_gesture,
    bool* was_blocked) {}

void WebDialogView::LoadingStateChanged(content::WebContents* source,
                                        bool should_show_loading_ui) {}

void WebDialogView::BeforeUnloadFired(content::WebContents* tab,
                                      bool proceed,
                                      bool* proceed_to_fire_unload) {}

bool WebDialogView::IsWebContentsCreationOverridden(
    content::SiteInstance* source_site_instance,
    content::mojom::WindowContainerType window_container_type,
    const GURL& opener_url,
    const std::string& frame_name,
    const GURL& target_url) {}

void WebDialogView::RequestMediaAccessPermission(
    content::WebContents* web_contents,
    const content::MediaStreamRequest& request,
    content::MediaResponseCallback callback) {}

bool WebDialogView::CheckMediaAccessPermission(
    content::RenderFrameHost* render_frame_host,
    const url::Origin& security_origin,
    blink::mojom::MediaStreamType type) {}

void WebDialogView::SetWebViewCornersRadii(const gfx::RoundedCornersF& radii) {}

////////////////////////////////////////////////////////////////////////////////
// WebDialogView, private:

void WebDialogView::InitDialog() {}

void WebDialogView::NotifyDialogWillClose() {}

BEGIN_METADATA()

}  // namespace views