chromium/chrome/browser/ui/views/constrained_web_dialog_delegate_views.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 "base/memory/raw_ptr.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/renderer_preferences_util.h"
#include "chrome/browser/ui/blocked_content/popunder_preventer.h"
#include "chrome/browser/ui/browser_element_identifiers.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/webui/chrome_web_contents_handler.h"
#include "chrome/browser/ui/webui/constrained_web_dialog_ui.h"
#include "components/constrained_window/constrained_window_views.h"
#include "components/input/native_web_keyboard_event.h"
#include "components/web_modal/web_contents_modal_dialog_manager.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/web_contents.h"
#include "ui/base/metadata/metadata_header_macros.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/base/mojom/ui_base_types.mojom-shared.h"
#include "ui/views/controls/webview/unhandled_keyboard_event_handler.h"
#include "ui/views/controls/webview/webview.h"
#include "ui/views/view.h"
#include "ui/views/view_class_properties.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"

namespace {

gfx::Size RestrictToPlatformMinimumSize(const gfx::Size& min_size) {}

class ConstrainedWebDialogDelegateViews;

// The specialized WebView that lives in a constrained dialog.
class ConstrainedDialogWebView : public views::WebView,
                                 public ConstrainedWebDialogDelegate,
                                 public views::WidgetDelegate {};

BEGIN_METADATA()

class WebDialogWebContentsDelegateViews
    : public ui::WebDialogWebContentsDelegate {};

// Views implementation of ConstrainedWebDialogDelegate.
class ConstrainedWebDialogDelegateViews
    : public ConstrainedWebDialogDelegate,
      public ui::WebDialogWebContentsDelegate {};

WebContents;
NativeWebKeyboardEvent;
WebDialogDelegate;
WebDialogWebContentsDelegate;

ConstrainedWebDialogDelegateViews::ConstrainedWebDialogDelegateViews(
    content::BrowserContext* browser_context,
    std::unique_ptr<WebDialogDelegate> web_dialog_delegate,
    content::WebContents* initiator_web_contents,
    ConstrainedDialogWebView* view)
    :{}

ConstrainedWebDialogDelegateViews::~ConstrainedWebDialogDelegateViews() {}

const WebDialogDelegate*
ConstrainedWebDialogDelegateViews::GetWebDialogDelegate() const {}

WebDialogDelegate* ConstrainedWebDialogDelegateViews::GetWebDialogDelegate() {}

void ConstrainedWebDialogDelegateViews::OnDialogCloseFromWebUI() {}

bool ConstrainedWebDialogDelegateViews::closed_via_webui() const {}

std::unique_ptr<content::WebContents>
ConstrainedWebDialogDelegateViews::ReleaseWebContents() {}

WebContents* ConstrainedWebDialogDelegateViews::GetWebContents() {}

gfx::Size
ConstrainedWebDialogDelegateViews::GetConstrainedWebDialogMinimumSize() const {}

gfx::Size
ConstrainedWebDialogDelegateViews::GetConstrainedWebDialogMaximumSize() const {}

gfx::Size
ConstrainedWebDialogDelegateViews::GetConstrainedWebDialogPreferredSize()
    const {}

void ConstrainedWebDialogDelegateViews::ResizeToGivenSize(
    const gfx::Size size) {}

ConstrainedDialogWebView::ConstrainedDialogWebView(
    content::BrowserContext* browser_context,
    std::unique_ptr<ui::WebDialogDelegate> delegate,
    content::WebContents* web_contents,
    const gfx::Size& min_size,
    const gfx::Size& max_size)
    :{}
ConstrainedDialogWebView::~ConstrainedDialogWebView() {}

const ui::WebDialogDelegate* ConstrainedDialogWebView::GetWebDialogDelegate()
    const {}

ui::WebDialogDelegate* ConstrainedDialogWebView::GetWebDialogDelegate() {}

void ConstrainedDialogWebView::OnDialogCloseFromWebUI() {}

std::unique_ptr<content::WebContents>
ConstrainedDialogWebView::ReleaseWebContents() {}

gfx::NativeWindow ConstrainedDialogWebView::GetNativeDialog() {}

content::WebContents* ConstrainedDialogWebView::GetWebContents() {}

gfx::Size ConstrainedDialogWebView::GetConstrainedWebDialogPreferredSize()
    const {}

gfx::Size ConstrainedDialogWebView::GetConstrainedWebDialogMinimumSize() const {}

gfx::Size ConstrainedDialogWebView::GetConstrainedWebDialogMaximumSize() const {}

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

void ConstrainedDialogWebView::WindowClosing() {}

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

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

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

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

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

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

bool ConstrainedDialogWebView::ShouldShowCloseButton() const {}

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

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

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

gfx::Size ConstrainedDialogWebView::GetMaximumSize() const {}

void ConstrainedDialogWebView::DocumentOnLoadCompletedInPrimaryMainFrame() {}

}  // namespace

ConstrainedWebDialogDelegate* ShowConstrainedWebDialog(
    content::BrowserContext* browser_context,
    std::unique_ptr<ui::WebDialogDelegate> delegate,
    content::WebContents* web_contents) {}

ConstrainedWebDialogDelegate* ShowConstrainedWebDialogWithAutoResize(
    content::BrowserContext* browser_context,
    std::unique_ptr<ui::WebDialogDelegate> delegate,
    content::WebContents* web_contents,
    const gfx::Size& min_size,
    const gfx::Size& max_size) {}