chore: bump chromium to 105.0.5187.0 (main) (#34921)
* chore: bump chromium in DEPS to 105.0.5179.0 * chore: update patches * 3758224: Reland^2 "[flags] Enable freezing of flags"3758224
* chore: bump chromium in DEPS to 105.0.5181.0 * chore: update patches * chore: bump chromium in DEPS to 105.0.5183.0 * chore: bump chromium in DEPS to 105.0.5185.0 * chore: bump chromium in DEPS to 105.0.5187.0 * chore: update patches * 3723298: Pass RemoteFrame mojo channels through its creation messages.3723298
* 3737382: [Code Heath] Replace base::{ListValue,DictionaryValue} in skia et al3737382
* Pass RemoteFrame mojo channels through its creation messages.3723298
* Changed PrintRenderFrame.PrintWithParams mojo interface to use callback.3761203
* 3738183: [CSP] Add support for `DisableWasmEval`3738183
* 3740498: Move LinuxUI from //ui/views/linux_ui to //ui/linux3740498
* 3558277: Moves subsystem and semantics to enum class3558277
* chore: fix broken steps-electron-gn-check * 3749583: [arm64] Fix undefined symbol linker error3749583
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org> Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
parent
1b96a3aa1d
commit
9e0a3c44dd
78 changed files with 366 additions and 432 deletions
|
@ -150,7 +150,7 @@
|
|||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_LINUX)
|
||||
#include "ui/views/linux_ui/linux_ui.h"
|
||||
#include "ui/linux/linux_ui.h"
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
|
||||
|
@ -395,7 +395,7 @@ absl::optional<base::TimeDelta> GetCursorBlinkInterval() {
|
|||
if (system_value)
|
||||
return *system_value;
|
||||
#elif BUILDFLAG(IS_LINUX)
|
||||
if (auto* linux_ui = views::LinuxUI::instance())
|
||||
if (auto* linux_ui = ui::LinuxUi::instance())
|
||||
return linux_ui->GetCursorBlinkInterval();
|
||||
#elif BUILDFLAG(IS_WIN)
|
||||
const auto system_msec = ::GetCaretBlinkTime();
|
||||
|
|
|
@ -1541,8 +1541,8 @@ bool ElectronBrowserClient::PreSpawnChild(sandbox::TargetPolicy* policy,
|
|||
ChildSpawnFlags flags) {
|
||||
// Allow crashpad to communicate via named pipe.
|
||||
sandbox::ResultCode result = policy->AddRule(
|
||||
sandbox::TargetPolicy::SUBSYS_FILES,
|
||||
sandbox::TargetPolicy::FILES_ALLOW_ANY, L"\\??\\pipe\\crashpad_*");
|
||||
sandbox::SubSystem::kFiles, sandbox::Semantics::kFilesAllowAny,
|
||||
L"\\??\\pipe\\crashpad_*");
|
||||
if (result != sandbox::SBOX_ALL_OK)
|
||||
return false;
|
||||
return true;
|
||||
|
|
|
@ -76,9 +76,9 @@
|
|||
#include "ui/gfx/color_utils.h"
|
||||
#include "ui/gtk/gtk_compat.h" // nogncheck
|
||||
#include "ui/gtk/gtk_util.h" // nogncheck
|
||||
#include "ui/linux/linux_ui.h"
|
||||
#include "ui/linux/linux_ui_factory.h"
|
||||
#include "ui/ozone/public/ozone_platform.h"
|
||||
#include "ui/views/linux_ui/linux_ui.h"
|
||||
#include "ui/views/linux_ui/linux_ui_factory.h"
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
|
@ -366,7 +366,7 @@ void ElectronBrowserMainParts::PostDestroyThreads() {
|
|||
|
||||
void ElectronBrowserMainParts::ToolkitInitialized() {
|
||||
#if BUILDFLAG(IS_LINUX)
|
||||
auto linux_ui = CreateLinuxUi();
|
||||
auto linux_ui = ui::CreateLinuxUi();
|
||||
DCHECK(ui::LinuxInputMethodContextFactory::instance());
|
||||
|
||||
// Try loading gtk symbols used by Electron.
|
||||
|
@ -388,7 +388,7 @@ void ElectronBrowserMainParts::ToolkitInitialized() {
|
|||
// here returns a NativeThemeGtk, which monitors GTK settings.
|
||||
dark_theme_observer_ = std::make_unique<DarkThemeObserver>();
|
||||
linux_ui->GetNativeTheme(nullptr)->AddObserver(dark_theme_observer_.get());
|
||||
views::LinuxUI::SetInstance(std::move(linux_ui));
|
||||
ui::LinuxUi::SetInstance(std::move(linux_ui));
|
||||
|
||||
// Cursor theme changes are tracked by LinuxUI (via a CursorThemeManager
|
||||
// implementation). Start observing them once it's initialized.
|
||||
|
|
|
@ -253,6 +253,7 @@ v8::Isolate* JavascriptEnvironment::Initialize(uv_loop_t* event_loop) {
|
|||
// --js-flags.
|
||||
std::string js_flags =
|
||||
cmd->GetSwitchValueASCII(blink::switches::kJavaScriptFlags);
|
||||
js_flags.append(" --no-freeze-flags-after-init");
|
||||
if (!js_flags.empty())
|
||||
v8::V8::SetFlagsFromString(js_flags.c_str(), js_flags.size());
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include <utility>
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "build/build_config.h"
|
||||
#include "components/printing/browser/print_to_pdf/pdf_print_utils.h"
|
||||
#include "printing/mojom/print.mojom.h"
|
||||
|
@ -133,7 +134,39 @@ void PrintViewManagerElectron::PrintToPdf(
|
|||
headless_jobs_.emplace_back(cookie);
|
||||
callback_ = std::move(callback);
|
||||
|
||||
GetPrintRenderFrame(rfh)->PrintWithParams(std::move(print_pages_params));
|
||||
// There is no need for a weak pointer here since the mojo proxy is held
|
||||
// in the base class. If we're gone, mojo will discard the callback.
|
||||
GetPrintRenderFrame(rfh)->PrintWithParams(
|
||||
std::move(print_pages_params),
|
||||
base::BindOnce(&PrintViewManagerElectron::OnDidPrintWithParams,
|
||||
base::Unretained(this)));
|
||||
}
|
||||
|
||||
void PrintViewManagerElectron::OnDidPrintWithParams(
|
||||
printing::mojom::PrintWithParamsResultPtr result) {
|
||||
if (result->is_failure_reason()) {
|
||||
switch (result->get_failure_reason()) {
|
||||
case printing::mojom::PrintFailureReason::kGeneralFailure:
|
||||
ReleaseJob(PRINTING_FAILED);
|
||||
return;
|
||||
case printing::mojom::PrintFailureReason::kInvalidPageRange:
|
||||
ReleaseJob(PAGE_COUNT_EXCEEDED);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
auto& content = *result->get_params()->content;
|
||||
if (!content.metafile_data_region.IsValid()) {
|
||||
ReleaseJob(INVALID_MEMORY_HANDLE);
|
||||
return;
|
||||
}
|
||||
base::ReadOnlySharedMemoryMapping map = content.metafile_data_region.Map();
|
||||
if (!map.IsValid()) {
|
||||
ReleaseJob(METAFILE_MAP_ERROR);
|
||||
return;
|
||||
}
|
||||
data_ = std::string(static_cast<const char*>(map.memory()), map.size());
|
||||
ReleaseJob(PRINT_SUCCESS);
|
||||
}
|
||||
|
||||
void PrintViewManagerElectron::GetDefaultPrintSettings(
|
||||
|
@ -171,20 +204,6 @@ void PrintViewManagerElectron::ShowInvalidPrinterSettingsError() {
|
|||
ReleaseJob(INVALID_PRINTER_SETTINGS);
|
||||
}
|
||||
|
||||
void PrintViewManagerElectron::PrintingFailed(
|
||||
int32_t cookie,
|
||||
printing::mojom::PrintFailureReason reason) {
|
||||
auto entry = std::find(headless_jobs_.begin(), headless_jobs_.end(), cookie);
|
||||
if (entry == headless_jobs_.end()) {
|
||||
PrintViewManagerBase::PrintingFailed(cookie, reason);
|
||||
return;
|
||||
}
|
||||
|
||||
ReleaseJob(reason == printing::mojom::PrintFailureReason::kInvalidPageRange
|
||||
? PAGE_COUNT_EXCEEDED
|
||||
: PRINTING_FAILED);
|
||||
}
|
||||
|
||||
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||
void PrintViewManagerElectron::UpdatePrintSettings(
|
||||
int32_t cookie,
|
||||
|
@ -245,37 +264,6 @@ void PrintViewManagerElectron::DidGetPrintedPagesCount(int32_t cookie,
|
|||
}
|
||||
}
|
||||
|
||||
void PrintViewManagerElectron::DidPrintDocument(
|
||||
printing::mojom::DidPrintDocumentParamsPtr params,
|
||||
DidPrintDocumentCallback callback) {
|
||||
auto entry = std::find(headless_jobs_.begin(), headless_jobs_.end(),
|
||||
params->document_cookie);
|
||||
if (entry == headless_jobs_.end()) {
|
||||
PrintViewManagerBase::DidPrintDocument(std::move(params),
|
||||
std::move(callback));
|
||||
return;
|
||||
}
|
||||
|
||||
auto& content = *params->content;
|
||||
if (!content.metafile_data_region.IsValid()) {
|
||||
ReleaseJob(INVALID_MEMORY_HANDLE);
|
||||
std::move(callback).Run(false);
|
||||
return;
|
||||
}
|
||||
|
||||
base::ReadOnlySharedMemoryMapping map = content.metafile_data_region.Map();
|
||||
if (!map.IsValid()) {
|
||||
ReleaseJob(METAFILE_MAP_ERROR);
|
||||
std::move(callback).Run(false);
|
||||
return;
|
||||
}
|
||||
|
||||
data_ = std::string(static_cast<const char*>(map.memory()), map.size());
|
||||
headless_jobs_.erase(entry);
|
||||
std::move(callback).Run(true);
|
||||
ReleaseJob(PRINT_SUCCESS);
|
||||
}
|
||||
|
||||
void PrintViewManagerElectron::Reset() {
|
||||
printing_rfh_ = nullptr;
|
||||
callback_.Reset();
|
||||
|
|
|
@ -61,23 +61,22 @@ class PrintViewManagerElectron
|
|||
PrintToPDFCallback callback);
|
||||
|
||||
private:
|
||||
explicit PrintViewManagerElectron(content::WebContents* web_contents);
|
||||
friend class content::WebContentsUserData<PrintViewManagerElectron>;
|
||||
|
||||
explicit PrintViewManagerElectron(content::WebContents* web_contents);
|
||||
|
||||
void OnDidPrintWithParams(printing::mojom::PrintWithParamsResultPtr result);
|
||||
|
||||
// WebContentsObserver overrides (via PrintManager):
|
||||
void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override;
|
||||
|
||||
// printing::mojom::PrintManagerHost:
|
||||
void DidPrintDocument(printing::mojom::DidPrintDocumentParamsPtr params,
|
||||
DidPrintDocumentCallback callback) override;
|
||||
void DidGetPrintedPagesCount(int32_t cookie, uint32_t number_pages) override;
|
||||
void GetDefaultPrintSettings(
|
||||
GetDefaultPrintSettingsCallback callback) override;
|
||||
void ScriptedPrint(printing::mojom::ScriptedPrintParamsPtr params,
|
||||
ScriptedPrintCallback callback) override;
|
||||
void ShowInvalidPrinterSettingsError() override;
|
||||
void PrintingFailed(int32_t cookie,
|
||||
printing::mojom::PrintFailureReason reason) override;
|
||||
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||
void UpdatePrintSettings(int32_t cookie,
|
||||
base::Value::Dict job_settings,
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
#include "shell/browser/ui/views/client_frame_view_linux.h"
|
||||
#include "ui/gfx/geometry/rect.h"
|
||||
#include "ui/gfx/geometry/skia_conversions.h"
|
||||
#include "ui/linux/linux_ui.h"
|
||||
#include "ui/platform_window/platform_window.h"
|
||||
#include "ui/views/linux_ui/linux_ui.h"
|
||||
#include "ui/views/widget/desktop_aura/desktop_window_tree_host.h"
|
||||
#include "ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h"
|
||||
#include "ui/views/window/non_client_view.h"
|
||||
|
|
|
@ -13,9 +13,9 @@
|
|||
#include "shell/browser/native_window_views.h"
|
||||
#include "shell/browser/ui/views/client_frame_view_linux.h"
|
||||
#include "third_party/skia/include/core/SkRRect.h"
|
||||
#include "ui/linux/device_scale_factor_observer.h"
|
||||
#include "ui/native_theme/native_theme_observer.h"
|
||||
#include "ui/platform_window/platform_window.h"
|
||||
#include "ui/views/linux_ui/device_scale_factor_observer.h"
|
||||
#include "ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h"
|
||||
|
||||
namespace electron {
|
||||
|
@ -23,7 +23,7 @@ namespace electron {
|
|||
class ElectronDesktopWindowTreeHostLinux
|
||||
: public views::DesktopWindowTreeHostLinux,
|
||||
public ui::NativeThemeObserver,
|
||||
public views::DeviceScaleFactorObserver {
|
||||
public ui::DeviceScaleFactorObserver {
|
||||
public:
|
||||
ElectronDesktopWindowTreeHostLinux(
|
||||
NativeWindowViews* native_window_view,
|
||||
|
@ -62,10 +62,10 @@ class ElectronDesktopWindowTreeHostLinux
|
|||
|
||||
base::ScopedObservation<ui::NativeTheme, ui::NativeThemeObserver>
|
||||
theme_observation_{this};
|
||||
base::ScopedObservation<views::LinuxUI,
|
||||
views::DeviceScaleFactorObserver,
|
||||
&views::LinuxUI::AddDeviceScaleFactorObserver,
|
||||
&views::LinuxUI::RemoveDeviceScaleFactorObserver>
|
||||
base::ScopedObservation<ui::LinuxUi,
|
||||
ui::DeviceScaleFactorObserver,
|
||||
&ui::LinuxUi::AddDeviceScaleFactorObserver,
|
||||
&ui::LinuxUi::RemoveDeviceScaleFactorObserver>
|
||||
scale_observation_{this};
|
||||
ui::PlatformWindowState window_state_ = ui::PlatformWindowState::kUnknown;
|
||||
};
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#include "base/nix/xdg_util.h"
|
||||
#include "third_party/skia/include/core/SkImage.h"
|
||||
#include "ui/base/glib/glib_signal.h"
|
||||
#include "ui/views/linux_ui/status_icon_linux.h"
|
||||
#include "ui/linux/status_icon_linux.h"
|
||||
|
||||
typedef struct _AppIndicator AppIndicator;
|
||||
typedef struct _GtkWidget GtkWidget;
|
||||
|
@ -33,7 +33,7 @@ namespace electron::gtkui {
|
|||
class AppIndicatorIconMenu;
|
||||
|
||||
// Status icon implementation which uses libappindicator.
|
||||
class AppIndicatorIcon : public views::StatusIconLinux {
|
||||
class AppIndicatorIcon : public ui::StatusIconLinux {
|
||||
public:
|
||||
// The id uniquely identifies the new status icon from other chrome status
|
||||
// icons.
|
||||
|
@ -49,7 +49,7 @@ class AppIndicatorIcon : public views::StatusIconLinux {
|
|||
// Indicates whether libappindicator so could be opened.
|
||||
static bool CouldOpen();
|
||||
|
||||
// Overridden from views::StatusIconLinux:
|
||||
// Overridden from ui::StatusIconLinux:
|
||||
void SetIcon(const gfx::ImageSkia& image) override;
|
||||
void SetToolTip(const std::u16string& tool_tip) override;
|
||||
void UpdatePlatformContextMenu(ui::MenuModel* menu) override;
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#include "ui/base/glib/glib_integers.h"
|
||||
#include "ui/base/glib/glib_signal.h"
|
||||
#include "ui/views/linux_ui/status_icon_linux.h"
|
||||
#include "ui/linux/status_icon_linux.h"
|
||||
|
||||
typedef struct _GtkStatusIcon GtkStatusIcon;
|
||||
|
||||
|
@ -27,7 +27,7 @@ class AppIndicatorIconMenu;
|
|||
|
||||
// Status icon implementation which uses the system tray X11 spec (via
|
||||
// GtkStatusIcon).
|
||||
class GtkStatusIcon : public views::StatusIconLinux {
|
||||
class GtkStatusIcon : public ui::StatusIconLinux {
|
||||
public:
|
||||
GtkStatusIcon(const gfx::ImageSkia& image, const std::u16string& tool_tip);
|
||||
~GtkStatusIcon() override;
|
||||
|
@ -36,7 +36,7 @@ class GtkStatusIcon : public views::StatusIconLinux {
|
|||
GtkStatusIcon(const GtkStatusIcon&) = delete;
|
||||
GtkStatusIcon& operator=(const GtkStatusIcon&) = delete;
|
||||
|
||||
// Overridden from views::StatusIconLinux:
|
||||
// Overridden from ui::StatusIconLinux:
|
||||
void SetIcon(const gfx::ImageSkia& image) override;
|
||||
void SetToolTip(const std::u16string& tool_tip) override;
|
||||
void UpdatePlatformContextMenu(ui::MenuModel* menu) override;
|
||||
|
|
|
@ -33,7 +33,7 @@ bool IsStatusIconSupported() {
|
|||
#endif
|
||||
}
|
||||
|
||||
std::unique_ptr<views::StatusIconLinux> CreateLinuxStatusIcon(
|
||||
std::unique_ptr<ui::StatusIconLinux> CreateLinuxStatusIcon(
|
||||
const gfx::ImageSkia& image,
|
||||
const std::u16string& tool_tip,
|
||||
const char* id_prefix) {
|
||||
|
|
|
@ -13,12 +13,12 @@
|
|||
|
||||
#include "base/strings/string_util.h"
|
||||
#include "ui/gfx/image/image_skia.h"
|
||||
#include "ui/views/linux_ui/status_icon_linux.h"
|
||||
#include "ui/linux/status_icon_linux.h"
|
||||
|
||||
namespace electron::gtkui {
|
||||
|
||||
bool IsStatusIconSupported();
|
||||
std::unique_ptr<views::StatusIconLinux> CreateLinuxStatusIcon(
|
||||
std::unique_ptr<ui::StatusIconLinux> CreateLinuxStatusIcon(
|
||||
const gfx::ImageSkia& image,
|
||||
const std::u16string& tool_tip,
|
||||
const char* id_prefix);
|
||||
|
|
|
@ -9,11 +9,11 @@
|
|||
#include <string>
|
||||
|
||||
#include "shell/browser/ui/tray_icon.h"
|
||||
#include "ui/views/linux_ui/status_icon_linux.h"
|
||||
#include "ui/linux/status_icon_linux.h"
|
||||
|
||||
namespace electron {
|
||||
|
||||
class TrayIconGtk : public TrayIcon, public views::StatusIconLinux::Delegate {
|
||||
class TrayIconGtk : public TrayIcon, public ui::StatusIconLinux::Delegate {
|
||||
public:
|
||||
TrayIconGtk();
|
||||
~TrayIconGtk() override;
|
||||
|
@ -23,7 +23,7 @@ class TrayIconGtk : public TrayIcon, public views::StatusIconLinux::Delegate {
|
|||
void SetToolTip(const std::string& tool_tip) override;
|
||||
void SetContextMenu(ElectronMenuModel* menu_model) override;
|
||||
|
||||
// views::StatusIconLinux::Delegate
|
||||
// ui::StatusIconLinux::Delegate
|
||||
void OnClick() override;
|
||||
bool HasClickAction() override;
|
||||
// The following four methods are only used by StatusIconLinuxDbus, which we
|
||||
|
@ -34,7 +34,7 @@ class TrayIconGtk : public TrayIcon, public views::StatusIconLinux::Delegate {
|
|||
void OnImplInitializationFailed() override;
|
||||
|
||||
private:
|
||||
std::unique_ptr<views::StatusIconLinux> icon_;
|
||||
std::unique_ptr<ui::StatusIconLinux> icon_;
|
||||
gfx::ImageSkia image_;
|
||||
std::u16string tool_tip_;
|
||||
ui::MenuModel* menu_model_;
|
||||
|
|
|
@ -23,11 +23,11 @@
|
|||
#include "ui/gfx/text_constants.h"
|
||||
#include "ui/gtk/gtk_compat.h" // nogncheck
|
||||
#include "ui/gtk/gtk_util.h" // nogncheck
|
||||
#include "ui/linux/linux_ui.h"
|
||||
#include "ui/linux/nav_button_provider.h"
|
||||
#include "ui/native_theme/native_theme.h"
|
||||
#include "ui/strings/grit/ui_strings.h"
|
||||
#include "ui/views/controls/button/image_button.h"
|
||||
#include "ui/views/linux_ui/linux_ui.h"
|
||||
#include "ui/views/linux_ui/nav_button_provider.h"
|
||||
#include "ui/views/style/typography.h"
|
||||
#include "ui/views/widget/widget.h"
|
||||
#include "ui/views/window/frame_buttons.h"
|
||||
|
@ -41,6 +41,25 @@ namespace {
|
|||
constexpr int kResizeOutsideBorderSize = 10;
|
||||
constexpr int kResizeInsideBoundsSize = 5;
|
||||
|
||||
ui::NavButtonProvider::ButtonState ButtonStateToNavButtonProviderState(
|
||||
views::Button::ButtonState state) {
|
||||
switch (state) {
|
||||
case views::Button::STATE_NORMAL:
|
||||
return ui::NavButtonProvider::ButtonState::kNormal;
|
||||
case views::Button::STATE_HOVERED:
|
||||
return ui::NavButtonProvider::ButtonState::kHovered;
|
||||
case views::Button::STATE_PRESSED:
|
||||
return ui::NavButtonProvider::ButtonState::kPressed;
|
||||
case views::Button::STATE_DISABLED:
|
||||
return ui::NavButtonProvider::ButtonState::kDisabled;
|
||||
|
||||
case views::Button::STATE_COUNT:
|
||||
default:
|
||||
NOTREACHED();
|
||||
return ui::NavButtonProvider::ButtonState::kNormal;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
// static
|
||||
|
@ -48,19 +67,18 @@ const char ClientFrameViewLinux::kViewClassName[] = "ClientFrameView";
|
|||
|
||||
ClientFrameViewLinux::ClientFrameViewLinux()
|
||||
: theme_(ui::NativeTheme::GetInstanceForNativeUi()),
|
||||
nav_button_provider_(
|
||||
views::LinuxUI::instance()->CreateNavButtonProvider()),
|
||||
nav_button_provider_(ui::LinuxUi::instance()->CreateNavButtonProvider()),
|
||||
nav_buttons_{
|
||||
NavButton{views::NavButtonProvider::FrameButtonDisplayType::kClose,
|
||||
NavButton{ui::NavButtonProvider::FrameButtonDisplayType::kClose,
|
||||
views::FrameButton::kClose, &views::Widget::Close,
|
||||
IDS_APP_ACCNAME_CLOSE, HTCLOSE},
|
||||
NavButton{views::NavButtonProvider::FrameButtonDisplayType::kMaximize,
|
||||
NavButton{ui::NavButtonProvider::FrameButtonDisplayType::kMaximize,
|
||||
views::FrameButton::kMaximize, &views::Widget::Maximize,
|
||||
IDS_APP_ACCNAME_MAXIMIZE, HTMAXBUTTON},
|
||||
NavButton{views::NavButtonProvider::FrameButtonDisplayType::kRestore,
|
||||
NavButton{ui::NavButtonProvider::FrameButtonDisplayType::kRestore,
|
||||
views::FrameButton::kMaximize, &views::Widget::Restore,
|
||||
IDS_APP_ACCNAME_RESTORE, HTMAXBUTTON},
|
||||
NavButton{views::NavButtonProvider::FrameButtonDisplayType::kMinimize,
|
||||
NavButton{ui::NavButtonProvider::FrameButtonDisplayType::kMinimize,
|
||||
views::FrameButton::kMinimize, &views::Widget::Minimize,
|
||||
IDS_APP_ACCNAME_MINIMIZE, HTMINBUTTON},
|
||||
},
|
||||
|
@ -85,14 +103,14 @@ ClientFrameViewLinux::ClientFrameViewLinux()
|
|||
|
||||
native_theme_observer_.Observe(theme_);
|
||||
|
||||
if (views::LinuxUI* ui = views::LinuxUI::instance()) {
|
||||
if (ui::LinuxUi* ui = ui::LinuxUi::instance()) {
|
||||
ui->AddWindowButtonOrderObserver(this);
|
||||
OnWindowButtonOrderingChange();
|
||||
}
|
||||
}
|
||||
|
||||
ClientFrameViewLinux::~ClientFrameViewLinux() {
|
||||
if (views::LinuxUI* ui = views::LinuxUI::instance())
|
||||
if (ui::LinuxUi* ui = ui::LinuxUi::instance())
|
||||
ui->RemoveWindowButtonOrderObserver(this);
|
||||
theme_->RemoveObserver(this);
|
||||
}
|
||||
|
@ -112,7 +130,7 @@ void ClientFrameViewLinux::Init(NativeWindowViews* window,
|
|||
window->GetAcceleratedWidget()));
|
||||
host_supports_client_frame_shadow_ = tree_host->SupportsClientFrameShadow();
|
||||
|
||||
frame_provider_ = views::LinuxUI::instance()->GetWindowFrameProvider(
|
||||
frame_provider_ = ui::LinuxUi::instance()->GetWindowFrameProvider(
|
||||
!host_supports_client_frame_shadow_);
|
||||
|
||||
UpdateWindowTitle();
|
||||
|
@ -326,11 +344,11 @@ void ClientFrameViewLinux::UpdateThemeValues() {
|
|||
SchedulePaint();
|
||||
}
|
||||
|
||||
views::NavButtonProvider::FrameButtonDisplayType
|
||||
ui::NavButtonProvider::FrameButtonDisplayType
|
||||
ClientFrameViewLinux::GetButtonTypeToSkip() const {
|
||||
return frame_->IsMaximized()
|
||||
? views::NavButtonProvider::FrameButtonDisplayType::kMaximize
|
||||
: views::NavButtonProvider::FrameButtonDisplayType::kRestore;
|
||||
? ui::NavButtonProvider::FrameButtonDisplayType::kMaximize
|
||||
: ui::NavButtonProvider::FrameButtonDisplayType::kRestore;
|
||||
}
|
||||
|
||||
void ClientFrameViewLinux::UpdateButtonImages() {
|
||||
|
@ -338,7 +356,7 @@ void ClientFrameViewLinux::UpdateButtonImages() {
|
|||
frame_->IsMaximized(),
|
||||
ShouldPaintAsActive());
|
||||
|
||||
views::NavButtonProvider::FrameButtonDisplayType skip_type =
|
||||
ui::NavButtonProvider::FrameButtonDisplayType skip_type =
|
||||
GetButtonTypeToSkip();
|
||||
|
||||
for (NavButton& button : nav_buttons_) {
|
||||
|
@ -351,7 +369,8 @@ void ClientFrameViewLinux::UpdateButtonImages() {
|
|||
views::Button::ButtonState state =
|
||||
static_cast<views::Button::ButtonState>(state_id);
|
||||
button.button->SetImage(
|
||||
state, nav_button_provider_->GetImage(button.type, state));
|
||||
state, nav_button_provider_->GetImage(
|
||||
button.type, ButtonStateToNavButtonProviderState(state)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -369,7 +388,7 @@ void ClientFrameViewLinux::LayoutButtons() {
|
|||
void ClientFrameViewLinux::LayoutButtonsOnSide(
|
||||
ButtonSide side,
|
||||
gfx::Rect* remaining_content_bounds) {
|
||||
views::NavButtonProvider::FrameButtonDisplayType skip_type =
|
||||
ui::NavButtonProvider::FrameButtonDisplayType skip_type =
|
||||
GetButtonTypeToSkip();
|
||||
|
||||
std::vector<views::FrameButton> frame_buttons;
|
||||
|
|
|
@ -11,14 +11,14 @@
|
|||
|
||||
#include "base/scoped_observation.h"
|
||||
#include "shell/browser/ui/views/frameless_view.h"
|
||||
#include "ui/linux/linux_ui.h"
|
||||
#include "ui/linux/nav_button_provider.h"
|
||||
#include "ui/linux/window_button_order_observer.h"
|
||||
#include "ui/linux/window_frame_provider.h"
|
||||
#include "ui/native_theme/native_theme.h"
|
||||
#include "ui/native_theme/native_theme_observer.h"
|
||||
#include "ui/views/controls/button/image_button.h"
|
||||
#include "ui/views/controls/label.h"
|
||||
#include "ui/views/linux_ui/linux_ui.h"
|
||||
#include "ui/views/linux_ui/nav_button_provider.h"
|
||||
#include "ui/views/linux_ui/window_button_order_observer.h"
|
||||
#include "ui/views/linux_ui/window_frame_provider.h"
|
||||
#include "ui/views/widget/widget.h"
|
||||
#include "ui/views/window/frame_buttons.h"
|
||||
|
||||
|
@ -26,7 +26,7 @@ namespace electron {
|
|||
|
||||
class ClientFrameViewLinux : public FramelessView,
|
||||
public ui::NativeThemeObserver,
|
||||
public views::WindowButtonOrderObserver {
|
||||
public ui::WindowButtonOrderObserver {
|
||||
public:
|
||||
static const char kViewClassName[];
|
||||
ClientFrameViewLinux();
|
||||
|
@ -71,7 +71,7 @@ class ClientFrameViewLinux : public FramelessView,
|
|||
static constexpr int kNavButtonCount = 4;
|
||||
|
||||
struct NavButton {
|
||||
views::NavButtonProvider::FrameButtonDisplayType type;
|
||||
ui::NavButtonProvider::FrameButtonDisplayType type;
|
||||
views::FrameButton frame_button;
|
||||
void (views::Widget::*callback)();
|
||||
int accessibility_id;
|
||||
|
@ -98,7 +98,7 @@ class ClientFrameViewLinux : public FramelessView,
|
|||
|
||||
enum class ButtonSide { kLeading, kTrailing };
|
||||
|
||||
views::NavButtonProvider::FrameButtonDisplayType GetButtonTypeToSkip() const;
|
||||
ui::NavButtonProvider::FrameButtonDisplayType GetButtonTypeToSkip() const;
|
||||
void UpdateButtonImages();
|
||||
void LayoutButtons();
|
||||
void LayoutButtonsOnSide(ButtonSide side,
|
||||
|
@ -115,7 +115,7 @@ class ClientFrameViewLinux : public FramelessView,
|
|||
|
||||
views::Label* title_;
|
||||
|
||||
std::unique_ptr<views::NavButtonProvider> nav_button_provider_;
|
||||
std::unique_ptr<ui::NavButtonProvider> nav_button_provider_;
|
||||
std::array<NavButton, kNavButtonCount> nav_buttons_;
|
||||
|
||||
std::vector<views::FrameButton> leading_frame_buttons_;
|
||||
|
@ -123,14 +123,14 @@ class ClientFrameViewLinux : public FramelessView,
|
|||
|
||||
bool host_supports_client_frame_shadow_ = false;
|
||||
|
||||
views::WindowFrameProvider* frame_provider_;
|
||||
ui::WindowFrameProvider* frame_provider_;
|
||||
|
||||
base::ScopedObservation<ui::NativeTheme, ui::NativeThemeObserver>
|
||||
native_theme_observer_{this};
|
||||
base::ScopedObservation<views::LinuxUI,
|
||||
views::WindowButtonOrderObserver,
|
||||
&views::LinuxUI::AddWindowButtonOrderObserver,
|
||||
&views::LinuxUI::RemoveWindowButtonOrderObserver>
|
||||
base::ScopedObservation<ui::LinuxUi,
|
||||
ui::WindowButtonOrderObserver,
|
||||
&ui::LinuxUi::AddWindowButtonOrderObserver,
|
||||
&ui::LinuxUi::RemoveWindowButtonOrderObserver>
|
||||
window_button_order_observer_{this};
|
||||
|
||||
base::CallbackListSubscription paint_as_active_changed_subscription_;
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#if BUILDFLAG(IS_LINUX)
|
||||
#include "base/environment.h"
|
||||
#include "base/nix/xdg_util.h"
|
||||
#include "ui/views/linux_ui/linux_ui.h"
|
||||
#include "ui/linux/linux_ui.h"
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
|
|
|
@ -49,7 +49,10 @@ void WebViewGuestDelegate::AttachToIframe(
|
|||
// frame |embedder_frame| hosts the inner WebContents.
|
||||
embedder_web_contents_->AttachInnerWebContents(
|
||||
base::WrapUnique<content::WebContents>(guest_web_contents),
|
||||
embedder_frame, false);
|
||||
embedder_frame,
|
||||
/*remote_frame=*/mojo::NullAssociatedRemote(),
|
||||
/*remote_frame_host_receiver=*/mojo::NullAssociatedReceiver(),
|
||||
/*is_full_page=*/false);
|
||||
|
||||
ResetZoomController();
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ v8::Local<v8::Value> Converter<base::Value::Dict>::ToV8(
|
|||
const base::Value::Dict& val) {
|
||||
base::Value value(val.Clone());
|
||||
return content::V8ValueConverter::Create()->ToV8Value(
|
||||
&value, isolate->GetCurrentContext());
|
||||
value, isolate->GetCurrentContext());
|
||||
}
|
||||
|
||||
bool Converter<base::Value>::FromV8(v8::Isolate* isolate,
|
||||
|
@ -50,7 +50,7 @@ bool Converter<base::Value>::FromV8(v8::Isolate* isolate,
|
|||
v8::Local<v8::Value> Converter<base::Value>::ToV8(v8::Isolate* isolate,
|
||||
const base::Value& val) {
|
||||
return content::V8ValueConverter::Create()->ToV8Value(
|
||||
&val, isolate->GetCurrentContext());
|
||||
val, isolate->GetCurrentContext());
|
||||
}
|
||||
|
||||
bool Converter<base::Value::List>::FromV8(v8::Isolate* isolate,
|
||||
|
@ -72,7 +72,7 @@ v8::Local<v8::Value> Converter<base::Value::List>::ToV8(
|
|||
const base::Value::List& val) {
|
||||
base::Value value(val.Clone());
|
||||
return content::V8ValueConverter::Create()->ToV8Value(
|
||||
&value, isolate->GetCurrentContext());
|
||||
value, isolate->GetCurrentContext());
|
||||
}
|
||||
|
||||
} // namespace gin
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue