#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "chrome/browser/ui/views/apps/chrome_native_app_window_views.h"
#include <stddef.h>
#include <utility>
#include "base/no_destructor.h"
#include "base/not_fatal_until.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/app_mode/app_mode_utils.h"
#include "chrome/browser/devtools/devtools_toggle_action.h"
#include "chrome/browser/devtools/devtools_window.h"
#include "chrome/browser/extensions/chrome_app_icon.h"
#include "chrome/browser/extensions/chrome_app_icon_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/views/accelerator_table.h"
#include "chrome/browser/ui/views/extensions/extension_keybinding_registry_views.h"
#include "components/favicon/content/content_favicon_driver.h"
#include "components/zoom/page_zoom.h"
#include "components/zoom/zoom_controller.h"
#include "extensions/browser/app_window/app_delegate.h"
#include "extensions/browser/extension_util.h"
#include "third_party/skia/include/core/SkRegion.h"
#include "ui/base/models/image_model.h"
#include "ui/gfx/geometry/rounded_corners_f.h"
#include "ui/gfx/geometry/skia_conversions.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/image/image_skia_operations.h"
#include "ui/views/controls/webview/webview.h"
#include "ui/views/widget/widget.h"
AppWindow;
namespace {
const AcceleratorMapping kAppWindowAcceleratorMap[] = …;
const AcceleratorMapping kAppWindowKioskAppModeAcceleratorMap[] = …;
std::map<ui::Accelerator, int> AcceleratorsFromMapping(
const AcceleratorMapping mapping_array[],
size_t mapping_length) { … }
const std::map<ui::Accelerator, int>& GetAcceleratorTable() { … }
}
ChromeNativeAppWindowViews::ChromeNativeAppWindowViews() = default;
ChromeNativeAppWindowViews::~ChromeNativeAppWindowViews() = default;
void ChromeNativeAppWindowViews::OnBeforeWidgetInit(
const AppWindow::CreateParams& create_params,
views::Widget::InitParams* init_params,
views::Widget* widget) { … }
void ChromeNativeAppWindowViews::InitializeDefaultWindow(
const AppWindow::CreateParams& create_params) { … }
std::unique_ptr<views::NonClientFrameView>
ChromeNativeAppWindowViews::CreateStandardDesktopAppFrame() { … }
bool ChromeNativeAppWindowViews::ShouldRemoveStandardFrame() { … }
gfx::Rect ChromeNativeAppWindowViews::GetRestoredBounds() const { … }
ui::WindowShowState ChromeNativeAppWindowViews::GetRestoredState() const { … }
ui::ZOrderLevel ChromeNativeAppWindowViews::GetZOrderLevel() const { … }
ui::ImageModel ChromeNativeAppWindowViews::GetWindowAppIcon() { … }
ui::ImageModel ChromeNativeAppWindowViews::GetWindowIcon() { … }
std::unique_ptr<views::NonClientFrameView>
ChromeNativeAppWindowViews::CreateNonClientFrameView(views::Widget* widget) { … }
bool ChromeNativeAppWindowViews::WidgetHasHitTestMask() const { … }
void ChromeNativeAppWindowViews::GetWidgetHitTestMask(SkPath* mask) const { … }
bool ChromeNativeAppWindowViews::AcceleratorPressed(
const ui::Accelerator& accelerator) { … }
void ChromeNativeAppWindowViews::SetFullscreen(int fullscreen_types) { … }
bool ChromeNativeAppWindowViews::IsFullscreenOrPending() const { … }
void ChromeNativeAppWindowViews::UpdateShape(
std::unique_ptr<ShapeRects> rects) { … }
bool ChromeNativeAppWindowViews::HasFrameColor() const { … }
SkColor ChromeNativeAppWindowViews::ActiveFrameColor() const { … }
SkColor ChromeNativeAppWindowViews::InactiveFrameColor() const { … }
void ChromeNativeAppWindowViews::InitializeWindow(
AppWindow* app_window,
const AppWindow::CreateParams& create_params) { … }
gfx::Image ChromeNativeAppWindowViews::GetCustomImage() { … }
gfx::Image ChromeNativeAppWindowViews::GetAppIconImage() { … }
void ChromeNativeAppWindowViews::EnsureAppIconCreated() { … }
void ChromeNativeAppWindowViews::OnIconUpdated(
extensions::ChromeAppIcon* icon) { … }