#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include <stddef.h>
#include <algorithm>
#include <memory>
#include "base/command_line.h"
#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "content/public/browser/context_factory.h"
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/web_contents.h"
#include "content/shell/browser/shell.h"
#include "content/shell/browser/shell_platform_delegate.h"
#include "ui/aura/env.h"
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_tree_host.h"
#include "ui/base/clipboard/clipboard.h"
#include "ui/base/metadata/metadata_header_macros.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/color/color_id.h"
#include "ui/events/event.h"
#include "ui/views/background.h"
#include "ui/views/controls/button/md_text_button.h"
#include "ui/views/controls/textfield/textfield.h"
#include "ui/views/controls/textfield/textfield_controller.h"
#include "ui/views/controls/webview/webview.h"
#include "ui/views/layout/box_layout_view.h"
#include "ui/views/layout/flex_layout_types.h"
#include "ui/views/layout/flex_layout_view.h"
#include "ui/views/test/desktop_test_views_delegate.h"
#include "ui/views/view.h"
#include "ui/views/view_class_properties.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_delegate.h"
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "ui/wm/test/wm_test_helper.h"
#else
#include "ui/display/screen.h"
#include "ui/views/widget/desktop_aura/desktop_screen.h"
#include "ui/wm/core/wm_state.h"
#endif
#if BUILDFLAG(IS_WIN)
#include <fcntl.h>
#include <io.h>
#endif
namespace content {
struct ShellPlatformDelegate::ShellData { … };
struct ShellPlatformDelegate::PlatformData { … };
namespace {
class ShellView : public views::BoxLayoutView,
public views::TextfieldController { … };
BEGIN_METADATA(…)
ShellView* ShellViewForWidget(views::Widget* widget) { … }
}
ShellPlatformDelegate::ShellPlatformDelegate() = default;
void ShellPlatformDelegate::Initialize(const gfx::Size& default_window_size) { … }
ShellPlatformDelegate::~ShellPlatformDelegate() = default;
void ShellPlatformDelegate::CreatePlatformWindow(
Shell* shell,
const gfx::Size& initial_size) { … }
gfx::NativeWindow ShellPlatformDelegate::GetNativeWindow(Shell* shell) { … }
void ShellPlatformDelegate::CleanUp(Shell* shell) { … }
void ShellPlatformDelegate::SetContents(Shell* shell) { … }
void ShellPlatformDelegate::ResizeWebContent(Shell* shell,
const gfx::Size& content_size) { … }
void ShellPlatformDelegate::EnableUIControl(Shell* shell,
UIControl control,
bool is_enabled) { … }
void ShellPlatformDelegate::SetAddressBarURL(Shell* shell, const GURL& url) { … }
void ShellPlatformDelegate::SetIsLoading(Shell* shell, bool loading) { … }
void ShellPlatformDelegate::SetTitle(Shell* shell,
const std::u16string& title) { … }
void ShellPlatformDelegate::MainFrameCreated(Shell* shell) { … }
bool ShellPlatformDelegate::DestroyShell(Shell* shell) { … }
}