electron/shell/browser/ui/views/electron_views_delegate.h
electron-roller[bot] af58931efa
chore: bump chromium to 131.0.6744.0 (main) (#43948)
* chore: bump chromium in DEPS to 131.0.6738.0

* chore: bump chromium in DEPS to 131.0.6740.0

* 5889025: [LaCrOS] Remove LaCrOS screen capturer. | https://chromium-review.googlesource.com/c/chromium/src/+/5889025

* https://boringssl.googlesource.com/boringssl.git/+/40dd94116ba03678226443ba20c5887459c9bf16/crypto/fipsmodule/digest/digests.c.inc

* chore: update patches

* 5878695: Add IsolationInfo for embedders handling external protocols | https://chromium-review.googlesource.com/c/chromium/src/+/5878695

* 5854304: [UI] Remove alias of mojom  | https://chromium-review.googlesource.com/c/chromium/src/+/5854304

* chore: bump chromium in DEPS to 131.0.6742.0

* chore: update patches

* chore: bump chromium in DEPS to 131.0.6744.0

* fixup! 5889025: [LaCrOS] Remove LaCrOS screen capturer. | https://chromium-review.googlesource.com/c/chromium/src/+/5889025

* chore: e patches all

* chore: update chore_provide_iswebcontentscreationoverridden_with_full_params.patch

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/5894233

* [UI] Remove alias of mojom 'WindowShowState'

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/5854304

* chore: gen-libc++-filenames.js

* chore: partially revert https://chromium-review.googlesource.com/c/chromium/src/+/5894233

see patch commit message for description

* Clean up stale base::Feature "kFileSystemAccessLocalUNCPathBlock"

This feature is always on by default and doesn't have active finch
experiments.

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/5881253

* fix: asar integrity test recognizes SIGABRT as a crash

https://chromium-review.googlesource.com/c/chromium/src/+/5882758

ValidateIntegrityOrDie() exits via LOG(FATAL)'s call to
base::ImmediateCrash(). There's been churn there upstream between
5332940 and 5882758 on whether to use SIGTRAP or SIGABRT.  For now,
let's accept both until the churn is done.

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: alice <alice@makenotion.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-09-30 14:54:44 +02:00

79 lines
2.9 KiB
C++

// Copyright (c) 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE-CHROMIUM file.
#ifndef ELECTRON_SHELL_BROWSER_UI_VIEWS_ELECTRON_VIEWS_DELEGATE_H_
#define ELECTRON_SHELL_BROWSER_UI_VIEWS_ELECTRON_VIEWS_DELEGATE_H_
#include <memory>
#include <string>
#include "base/containers/flat_map.h"
#include "ui/views/views_delegate.h"
namespace electron {
class ViewsDelegate : public views::ViewsDelegate {
public:
ViewsDelegate();
~ViewsDelegate() override;
// disable copy
ViewsDelegate(const ViewsDelegate&) = delete;
ViewsDelegate& operator=(const ViewsDelegate&) = delete;
protected:
// views::ViewsDelegate:
void SaveWindowPlacement(const views::Widget* window,
const std::string& window_name,
const gfx::Rect& bounds,
ui::mojom::WindowShowState show_state) override;
bool GetSavedWindowPlacement(
const views::Widget* widget,
const std::string& window_name,
gfx::Rect* bounds,
ui::mojom::WindowShowState* show_state) const override;
void NotifyMenuItemFocused(const std::u16string& menu_name,
const std::u16string& menu_item_name,
int item_index,
int item_count,
bool has_submenu) override;
#if BUILDFLAG(IS_WIN)
HICON GetDefaultWindowIcon() const override;
HICON GetSmallWindowIcon() const override;
int GetAppbarAutohideEdges(HMONITOR monitor,
base::OnceClosure callback) override;
#elif BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS)
gfx::ImageSkia* GetDefaultWindowIcon() const override;
#endif
std::unique_ptr<views::NonClientFrameView> CreateDefaultNonClientFrameView(
views::Widget* widget) override;
void AddRef() override {}
void ReleaseRef() override {}
void OnBeforeWidgetInit(
views::Widget::InitParams* params,
views::internal::NativeWidgetDelegate* delegate) override;
bool WindowManagerProvidesTitleBar(bool maximized) override;
private:
#if BUILDFLAG(IS_WIN)
// Callback on main thread with the edges. |returned_edges| is the value that
// was returned from the call to GetAutohideEdges() that initiated the lookup.
void OnGotAppbarAutohideEdges(base::OnceClosure callback,
HMONITOR monitor,
int returned_edges,
int edges);
base::flat_map<HMONITOR, int> appbar_autohide_edge_map_;
// If true we're in the process of notifying a callback from
// GetAutohideEdges().start a new query.
bool in_autohide_edges_callback_ = false;
base::WeakPtrFactory<ViewsDelegate> weak_factory_{this};
#endif
};
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_UI_VIEWS_ELECTRON_VIEWS_DELEGATE_H_