chore: bump chromium to 128.0.6558.0 (32-x-y) (#42746)

* chore: bump chromium to 128.0.6558.0 32-x-y

* chore: bump chromium in DEPS to 127.0.6526.0

* chore: update network_service_allow_remote_certificate_verification_logic.patch

manually apply patch due to minor upstream shear

Xref: 5598454

* chore: update fix_move_autopipsettingshelper_behind_branding_buildflag.patch

No manual changes; patch applied with fuzz 1

* chore: update refactor_expose_file_system_access_blocklist.patch

No manual changes; patch applied with fuzz 2

* chore: update revert_heap_add_checks_position_info.patch

No manual changes; patch applied with fuzz 1

* chore: e patches all

* chore: bump chromium in DEPS to 127.0.6527.0

* chore: update patches

* chore: bump chromium in DEPS to 127.0.6529.0

* chore: bump chromium in DEPS to 127.0.6531.0

* chore: update patches

* 5596349: Remove PDF OCR toggle from settings.

5596349

* 5585932: [video-pip] Add minimize button to video picture-in-picture window

5585932

* 5604487: Reland "[api] Deprecate v8::FunctionCallbackInfo::Holder() for real"

5604487

* 5581721: [DEPS] Update clang-format location

5581721

* 5597904: [Windows] Remove ConvertToLongPath from Sandbox Utilities.

5597904

ResolveNTFunctionPtr was removed in this CL.

* fix: visibility state specs on macOS

Refs 5605407

* Revert "fix: visibility state specs on macOS"

This reverts commit 1eee30a33dfafeec86cdd09526a07b01abca2ed6.

* temp: disable occlusion checker on macOS

* chore: bump chromium in DEPS to 128.0.6535.0

* chore: update patches

* [Extensions] Move some scriptings files out of the API directory.

Refs 5606682

* fix[node]: do not use soon-to-be-deprecated V8 API

* fix: update api_remove_allcan_read_write.patch

* chore: update patches

* chore: update patches

* chore: fix lf mismatch in api_remove_allcan_read_write.patch

* chore: update patches

* chore: bump chromium in DEPS to 128.0.6538.0

* chore: update v8 patches

* chore: update patches

* ui/gl/features.gni: Set use_egl=true unconditionally.

Refs 5569748
Refs https://issues.chromium.org/issues/344606399

* chore: bump chromium in DEPS to 128.0.6540.0

* chore: bump chromium in DEPS to 128.0.6541.0

* chore: update patches

* chore: fix nan read/write patch

* chore: bump chromium in DEPS to 128.0.6543.0

* 5626254: Use sandbox_type instead of process_type | 5626254

* chore: update patches

* rework nan patches

* 5621488: Apply consistent naming conventions to zoom values | 5621488

* chore: bump chromium in DEPS to 128.0.6544.0

* 5605693: Remove files from third_party/ninja | 5605693

* chore: update patches

* chore: maybe fix nan patch, part 3

* chore: delete nan patch

* chore: re-add nan patch (attempt 2)

* chore: add test patch

* fixup! add test patch

* chore: bump chromium in DEPS to 128.0.6549.0

* chore: bump chromium in DEPS to 128.0.6551.0

* 5637699: Add command line to ASAN Additional Info section | 5637699

* chore: update patches

* chore: bump chromium in DEPS to 128.0.6553.0

* chore: bump chromium in DEPS to 128.0.6555.0

* fix: add property query interceptors

* chore: bump chromium in DEPS to 128.0.6557.0

* 5583182: Automatic Fullscreen: Prototype Permissions API query support | 5583182

* 5613297: Move render input router and related dependencies to //components/input | 5613297

* chore: update patches

* test: skip methodswithdata-test.js nan test

* chore: bump chromium in DEPS to 128.0.6558.0

* chore: update patches

* build: reference correct ninja cipd ref

Ref: 5605693

* update libcxx filenames

* refactor: CursorManager moved to //components/input

Ref: 5613297

* refactor: spanify mojo Read/WriteData methods

Ref: 5619291

* refactor: remove constexpr from KeyboardCodeFromKeyIdentifier

Ref: unknown

Added TODO to investigate after

* chore: update patches

* refactor: improve type safety of a11y ids

Ref: 5614590

* chore: disable tls node tests that don't apply given boringssl tls configuration

Ref: https://boringssl-review.googlesource.com/c/boringssl/+/68487

* chore: add patch to fix nan v8 incompat with NamedPropertyHandlerConfiguration and IndexedPropertyHandlerConfiguration

Ref: 5630388

* fix: limit subspan length per feedback

* Fix incorrect CalculateInsetsInDIP check

* 5645742: Reland "Reland "Add toolchains without PartitionAlloc-Everywhere for dump_syms et al""

5645742

* chore: more Windows logging

* 5617471: Add NPU blocking to chromium blocklist

5617471

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
Co-authored-by: Alice Zhao <alice@makenotion.com>
Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>
Co-authored-by: VerteDinde <vertedinde@electronjs.org>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: cleanup .patches after trop

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
This commit is contained in:
trop[bot] 2024-07-03 10:54:21 -04:00 committed by GitHub
parent 37fc8346aa
commit c2939ef9af
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
122 changed files with 1602 additions and 1178 deletions

View file

@ -69,7 +69,7 @@ class DataPipeReader {
return;
}
buffer_.resize(size);
head_ = &buffer_.front();
head_offset_ = 0;
remaining_size_ = size;
handle_watcher_.ArmOrNotify();
}
@ -84,10 +84,13 @@ class DataPipeReader {
// Read.
size_t length = remaining_size_;
result = data_pipe_->ReadData(head_, &length, MOJO_READ_DATA_FLAG_NONE);
result = data_pipe_->ReadData(
MOJO_READ_DATA_FLAG_NONE,
base::as_writable_byte_span(buffer_).subspan(head_offset_, length),
length);
if (result == MOJO_RESULT_OK) { // success
remaining_size_ -= length;
head_ += length;
head_offset_ += length;
if (remaining_size_ == 0) {
OnSuccess();
} else {
@ -130,7 +133,7 @@ class DataPipeReader {
std::vector<char> buffer_;
// The head of buffer.
raw_ptr<char, AllowPtrArithmetic> head_ = nullptr;
size_t head_offset_ = 0;
// Remaining data to read.
uint64_t remaining_size_ = 0;

View file

@ -3595,13 +3595,13 @@ void WebContents::SetZoomFactor(gin_helper::ErrorThrower thrower,
return;
}
auto level = blink::PageZoomFactorToZoomLevel(factor);
auto level = blink::ZoomFactorToZoomLevel(factor);
SetZoomLevel(level);
}
double WebContents::GetZoomFactor() const {
auto level = GetZoomLevel();
return blink::PageZoomLevelToZoomFactor(level);
return blink::ZoomLevelToZoomFactor(level);
}
void WebContents::SetTemporaryZoomLevel(double level) {

View file

@ -12,6 +12,7 @@
#include "gpu/config/gpu_info_collector.h"
#include "shell/browser/api/gpu_info_enumerator.h"
#include "shell/common/gin_converters/value_converter.h"
#include "shell/common/thread_restrictions.h"
namespace electron {
@ -63,6 +64,11 @@ void GPUInfoManager::FetchCompleteInfo(
// This fetches the info synchronously, so no need to post to the task queue.
// There cannot be multiple promises as they are resolved synchronously.
void GPUInfoManager::FetchBasicInfo(gin_helper::Promise<base::Value> promise) {
#if BUILDFLAG(IS_WIN)
// Needed for CollectNPUInformation in gpu/config/gpu_info_collector_win.cc
// which calls blocking function base::LoadSystemLibrary.
electron::ScopedAllowBlockingForElectron allow_blocking;
#endif
gpu::GPUInfo gpu_info;
CollectBasicGraphicsInfo(&gpu_info);
promise.Resolve(base::Value(EnumerateGPUInfo(gpu_info)));

View file

@ -174,7 +174,7 @@ std::optional<int> GetZoomLevel(content::WebContents* capturer,
return std::nullopt;
}
double zoom_level = blink::PageZoomLevelToZoomFactor(
double zoom_level = blink::ZoomLevelToZoomFactor(
content::HostZoomMap::GetZoomLevel(captured_wc));
return std::round(100 * zoom_level);
}

View file

@ -26,8 +26,6 @@ namespace {
namespace IsAllowedLocalFileAccess =
api::pdf_viewer_private::IsAllowedLocalFileAccess;
namespace SetPdfOcrPref = api::pdf_viewer_private::SetPdfOcrPref;
namespace SetPdfPluginAttributes =
api::pdf_viewer_private::SetPdfPluginAttributes;
@ -141,32 +139,6 @@ PdfViewerPrivateSetPdfDocumentTitleFunction::Run() {
return RespondNow(NoArguments());
}
PdfViewerPrivateIsPdfOcrAlwaysActiveFunction::
PdfViewerPrivateIsPdfOcrAlwaysActiveFunction() = default;
PdfViewerPrivateIsPdfOcrAlwaysActiveFunction::
~PdfViewerPrivateIsPdfOcrAlwaysActiveFunction() = default;
// TODO(codebytere): enable when https://crbug.com/1393069 works properly.
ExtensionFunction::ResponseAction
PdfViewerPrivateIsPdfOcrAlwaysActiveFunction::Run() {
return RespondNow(WithArguments(false));
}
PdfViewerPrivateSetPdfOcrPrefFunction::PdfViewerPrivateSetPdfOcrPrefFunction() =
default;
PdfViewerPrivateSetPdfOcrPrefFunction::
~PdfViewerPrivateSetPdfOcrPrefFunction() = default;
// TODO(codebytere): enable when https://crbug.com/1393069 works properly.
ExtensionFunction::ResponseAction PdfViewerPrivateSetPdfOcrPrefFunction::Run() {
std::optional<SetPdfOcrPref::Params> params =
SetPdfOcrPref::Params::Create(args());
EXTENSION_FUNCTION_VALIDATE(params);
return RespondNow(WithArguments(false));
}
PdfViewerPrivateSetPdfPluginAttributesFunction::
PdfViewerPrivateSetPdfPluginAttributesFunction() = default;

View file

@ -64,42 +64,6 @@ class PdfViewerPrivateSetPdfDocumentTitleFunction : public ExtensionFunction {
ResponseAction Run() override;
};
class PdfViewerPrivateIsPdfOcrAlwaysActiveFunction : public ExtensionFunction {
public:
DECLARE_EXTENSION_FUNCTION("pdfViewerPrivate.isPdfOcrAlwaysActive",
PDFVIEWERPRIVATE_ISPDFOCRALWAYSACTIVE)
PdfViewerPrivateIsPdfOcrAlwaysActiveFunction();
PdfViewerPrivateIsPdfOcrAlwaysActiveFunction(
const PdfViewerPrivateIsPdfOcrAlwaysActiveFunction&) = delete;
PdfViewerPrivateIsPdfOcrAlwaysActiveFunction& operator=(
const PdfViewerPrivateIsPdfOcrAlwaysActiveFunction&) = delete;
protected:
~PdfViewerPrivateIsPdfOcrAlwaysActiveFunction() override;
// Override from ExtensionFunction:
ResponseAction Run() override;
};
class PdfViewerPrivateSetPdfOcrPrefFunction : public ExtensionFunction {
public:
DECLARE_EXTENSION_FUNCTION("pdfViewerPrivate.setPdfOcrPref",
PDFVIEWERPRIVATE_SETPDFOCRPREF)
PdfViewerPrivateSetPdfOcrPrefFunction();
PdfViewerPrivateSetPdfOcrPrefFunction(
const PdfViewerPrivateSetPdfOcrPrefFunction&) = delete;
PdfViewerPrivateSetPdfOcrPrefFunction& operator=(
const PdfViewerPrivateSetPdfOcrPrefFunction&) = delete;
protected:
~PdfViewerPrivateSetPdfOcrPrefFunction() override;
// Override from ExtensionFunction:
ResponseAction Run() override;
};
class PdfViewerPrivateSetPdfPluginAttributesFunction
: public ExtensionFunction {
public:

View file

@ -18,8 +18,6 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_entry.h"
#include "extensions/browser/api/scripting/scripting_constants.h"
#include "extensions/browser/api/scripting/scripting_utils.h"
#include "extensions/browser/extension_api_frame_id_map.h"
#include "extensions/browser/extension_file_task_runner.h"
#include "extensions/browser/extension_registry.h"
@ -28,6 +26,8 @@
#include "extensions/browser/extension_util.h"
#include "extensions/browser/load_and_localize_file.h"
#include "extensions/browser/script_executor.h"
#include "extensions/browser/scripting_constants.h"
#include "extensions/browser/scripting_utils.h"
#include "extensions/browser/user_script_manager.h"
#include "extensions/common/api/extension_types.h"
#include "extensions/common/api/scripts_internal.h"

View file

@ -12,9 +12,9 @@
#include <vector>
#include "chrome/common/extensions/api/scripting.h"
#include "extensions/browser/api/scripting/scripting_utils.h"
#include "extensions/browser/extension_function.h"
#include "extensions/browser/script_executor.h"
#include "extensions/browser/scripting_utils.h"
#include "extensions/common/mojom/code_injection.mojom.h"
#include "extensions/common/user_script.h"

View file

@ -365,11 +365,10 @@ ExtensionFunction::ResponseAction TabsSetZoomFunction::Run() {
return RespondNow(Error(error));
auto* zoom_controller = contents->GetZoomController();
double zoom_level =
params->zoom_factor > 0
? blink::PageZoomFactorToZoomLevel(params->zoom_factor)
: blink::PageZoomFactorToZoomLevel(
zoom_controller->default_zoom_factor());
double zoom_level = params->zoom_factor > 0
? blink::ZoomFactorToZoomLevel(params->zoom_factor)
: blink::ZoomFactorToZoomLevel(
zoom_controller->default_zoom_factor());
zoom_controller->SetZoomLevel(zoom_level);
@ -387,7 +386,7 @@ ExtensionFunction::ResponseAction TabsGetZoomFunction::Run() {
return RespondNow(Error("No such tab"));
double zoom_level = contents->GetZoomController()->GetZoomLevel();
double zoom_factor = blink::PageZoomLevelToZoomFactor(zoom_level);
double zoom_factor = blink::ZoomLevelToZoomFactor(zoom_level);
return RespondNow(ArgumentList(tabs::GetZoom::Results::Create(zoom_factor)));
}
@ -408,7 +407,7 @@ ExtensionFunction::ResponseAction TabsGetZoomSettingsFunction::Run() {
tabs::ZoomSettings zoom_settings;
ZoomModeToZoomSettings(zoom_mode, &zoom_settings);
zoom_settings.default_zoom_factor =
blink::PageZoomLevelToZoomFactor(zoom_controller->GetDefaultZoomLevel());
blink::ZoomLevelToZoomFactor(zoom_controller->GetDefaultZoomLevel());
return RespondNow(
ArgumentList(tabs::GetZoomSettings::Results::Create(zoom_settings)));

View file

@ -19,7 +19,8 @@
#include "third_party/blink/public/common/features.h"
#if BUILDFLAG(IS_MAC)
#include "device/base/features.h" // nogncheck
#include "content/common/features.h" // nogncheck
#include "device/base/features.h" // nogncheck
#endif
namespace electron {
@ -46,6 +47,12 @@ void InitializeFeatureList() {
// 'custom dictionary word list API' spec to crash.
std::string(",") + spellcheck::kWinDelaySpellcheckServiceInit.name;
#endif
#if BUILDFLAG(IS_MAC)
// Disable window occlusion checker.
disable_features +=
std::string(",") + features::kMacWebContentsOcclusion.name;
#endif
std::string platform_specific_enable_features =
EnablePlatformSpecificFeatures();
if (platform_specific_enable_features.size() > 0) {

View file

@ -221,13 +221,15 @@ class AsarURLLoader : public network::mojom::URLLoader {
// Write any data we read for MIME sniffing, constraining by range where
// applicable. This will always fit in the pipe (see assertion near
// |kDefaultFileUrlPipeSize| definition).
size_t write_size = std::min(
const size_t write_size = std::min(
(read_result.bytes_read - first_byte_to_send), total_bytes_to_send);
const size_t expected_write_size = write_size;
MojoResult result =
producer_handle->WriteData(&initial_read_buffer[first_byte_to_send],
&write_size, MOJO_WRITE_DATA_FLAG_NONE);
if (result != MOJO_RESULT_OK || write_size != expected_write_size) {
base::span<const uint8_t> bytes =
base::as_byte_span(initial_read_buffer)
.subspan(first_byte_to_send, write_size);
size_t bytes_written = 0;
MojoResult result = producer_handle->WriteData(
bytes, MOJO_WRITE_DATA_FLAG_NONE, bytes_written);
if (result != MOJO_RESULT_OK || write_size != bytes_written) {
OnFileWritten(result);
return;
}

View file

@ -16,6 +16,7 @@
#include "base/memory/raw_ptr.h"
#include "base/task/single_thread_task_runner.h"
#include "base/time/time.h"
#include "components/input/cursor_manager.h"
#include "components/viz/common/features.h"
#include "components/viz/common/frame_sinks/begin_frame_args.h"
#include "components/viz/common/frame_sinks/copy_output_request.h"
@ -23,7 +24,6 @@
#include "components/viz/common/quads/compositor_render_pass.h"
#include "content/browser/renderer_host/render_widget_host_delegate.h" // nogncheck
#include "content/browser/renderer_host/render_widget_host_owner_delegate.h" // nogncheck
#include "content/common/input/cursor_manager.h"
#include "content/common/input/synthetic_gesture.h" // nogncheck
#include "content/common/input/synthetic_gesture_target.h"
#include "content/public/browser/browser_task_traits.h"
@ -197,7 +197,7 @@ OffScreenRenderWidgetHostView::OffScreenRenderWidgetHostView(
AllocateFrameSinkId(),
delegated_frame_host_client_.get(),
true /* should_register_frame_sink_id */)},
cursor_manager_(std::make_unique<content::CursorManager>(this)),
cursor_manager_(std::make_unique<input::CursorManager>(this)),
mouse_wheel_phase_handler_(this),
backing_(std::make_unique<SkBitmap>()) {
DCHECK(render_widget_host_);
@ -449,7 +449,7 @@ void OffScreenRenderWidgetHostView::InitAsPopup(
void OffScreenRenderWidgetHostView::UpdateCursor(const ui::Cursor&) {}
content::CursorManager* OffScreenRenderWidgetHostView::GetCursorManager() {
input::CursorManager* OffScreenRenderWidgetHostView::GetCursorManager() {
return cursor_manager_.get();
}

View file

@ -44,7 +44,7 @@
#include "ui/gfx/win/window_impl.h"
#endif
namespace content {
namespace input {
class CursorManager;
}
@ -136,7 +136,7 @@ class OffScreenRenderWidgetHostView
void ShowWithVisibility(content::PageVisibilityState page_visibility) final;
void Destroy(void) override;
void UpdateTooltipUnderCursor(const std::u16string&) override;
content::CursorManager* GetCursorManager() override;
input::CursorManager* GetCursorManager() override;
void CopyFromSurface(
const gfx::Rect& src_rect,
const gfx::Size& output_size,
@ -304,7 +304,7 @@ class OffScreenRenderWidgetHostView
// depends-on: delegated_frame_host_client_
const std::unique_ptr<content::DelegatedFrameHost> delegated_frame_host_;
std::unique_ptr<content::CursorManager> cursor_manager_;
std::unique_ptr<input::CursorManager> cursor_manager_;
raw_ptr<OffScreenHostDisplayClient> host_display_client_;
std::unique_ptr<OffScreenVideoConsumer> video_consumer_;

View file

@ -8,6 +8,7 @@
#include "base/logging.h"
#include "base/process/launch.h"
#include "base/process/process_handle.h"
#include "base/strings/strcat_win.h"
#include "base/strings/string_number_conversions_win.h"
#include "base/strings/utf_string_conversions.h"
@ -44,24 +45,13 @@ struct PROCESS_BASIC_INFORMATION {
};
HANDLE GetParentProcessHandle(base::ProcessHandle handle) {
NtQueryInformationProcessFunction NtQueryInformationProcess = nullptr;
ResolveNTFunctionPtr("NtQueryInformationProcess", &NtQueryInformationProcess);
if (!NtQueryInformationProcess) {
LOG(ERROR) << "Unable to get NtQueryInformationProcess";
base::ProcessId ppid = base::GetParentProcessId(handle);
if (ppid == 0u) {
LOG(ERROR) << "Could not get parent process handle";
return nullptr;
}
PROCESS_BASIC_INFORMATION pbi;
LONG status =
NtQueryInformationProcess(handle, ProcessBasicInformation, &pbi,
sizeof(PROCESS_BASIC_INFORMATION), nullptr);
if (!NT_SUCCESS(status)) {
LOG(ERROR) << "NtQueryInformationProcess failed";
return nullptr;
}
return ::OpenProcess(PROCESS_ALL_ACCESS, TRUE,
pbi.InheritedFromUniqueProcessId);
return ::OpenProcess(PROCESS_ALL_ACCESS, TRUE, ppid);
}
StringType AddQuoteForArg(const StringType& arg) {

View file

@ -48,7 +48,12 @@ void ElectronDesktopWindowTreeHostLinux::OnWidgetInitDone() {
gfx::Insets ElectronDesktopWindowTreeHostLinux::CalculateInsetsInDIP(
ui::PlatformWindowState window_state) const {
// If we are not showing frame, the insets should be zero.
if (!native_window_view_->IsFullscreen()) {
if (native_window_view_->IsFullscreen()) {
return gfx::Insets();
}
if (!native_window_view_->has_frame() ||
!native_window_view_->has_client_frame()) {
return gfx::Insets();
}

View file

@ -127,15 +127,15 @@ void SetZoomLevelForWebContents(content::WebContents* web_contents,
}
double GetNextZoomLevel(double level, bool out) {
double factor = blink::PageZoomLevelToZoomFactor(level);
double factor = blink::ZoomLevelToZoomFactor(level);
size_t size = std::size(kPresetZoomFactors);
for (size_t i = 0; i < size; ++i) {
if (!blink::PageZoomValuesEqual(kPresetZoomFactors[i], factor))
if (!blink::ZoomValuesEqual(kPresetZoomFactors[i], factor))
continue;
if (out && i > 0)
return blink::PageZoomFactorToZoomLevel(kPresetZoomFactors[i - 1]);
return blink::ZoomFactorToZoomLevel(kPresetZoomFactors[i - 1]);
if (!out && i != size - 1)
return blink::PageZoomFactorToZoomLevel(kPresetZoomFactors[i + 1]);
return blink::ZoomFactorToZoomLevel(kPresetZoomFactors[i + 1]);
}
return level;
}

View file

@ -129,12 +129,6 @@ void ClientFrameViewLinux::Init(NativeWindowViews* window,
window->GetAcceleratedWidget()));
host_supports_client_frame_shadow_ = tree_host->SupportsClientFrameShadow();
bool tiled = tiled_edges().top || tiled_edges().left ||
tiled_edges().bottom || tiled_edges().right;
frame_provider_ =
ui::LinuxUiTheme::GetForProfile(nullptr)->GetWindowFrameProvider(
!host_supports_client_frame_shadow_, tiled, frame_->IsMaximized());
UpdateWindowTitle();
for (auto& button : nav_buttons_) {
@ -150,13 +144,14 @@ void ClientFrameViewLinux::Init(NativeWindowViews* window,
}
gfx::Insets ClientFrameViewLinux::GetBorderDecorationInsets() const {
const auto insets = frame_provider_->GetFrameThicknessDip();
const auto insets = GetFrameProvider()->GetFrameThicknessDip();
// We shouldn't draw frame decorations for the tiled edges.
// See https://wayland.app/protocols/xdg-shell#xdg_toplevel:enum:state
return gfx::Insets::TLBR(tiled_edges().top ? 0 : insets.top(),
tiled_edges().left ? 0 : insets.left(),
tiled_edges().bottom ? 0 : insets.bottom(),
tiled_edges().right ? 0 : insets.right());
const auto& edges = tiled_edges();
return gfx::Insets::TLBR(
edges.top ? 0 : insets.top(), edges.left ? 0 : insets.left(),
edges.bottom ? 0 : insets.bottom(), edges.right ? 0 : insets.right());
}
gfx::Insets ClientFrameViewLinux::GetInputInsets() const {
@ -244,6 +239,13 @@ int ClientFrameViewLinux::NonClientHitTest(const gfx::Point& point) {
return FramelessView::NonClientHitTest(point);
}
ui::WindowFrameProvider* ClientFrameViewLinux::GetFrameProvider() const {
const bool tiled = tiled_edges().top || tiled_edges().left ||
tiled_edges().bottom || tiled_edges().right;
return ui::LinuxUiTheme::GetForProfile(nullptr)->GetWindowFrameProvider(
!host_supports_client_frame_shadow_, tiled, frame_->IsMaximized());
}
void ClientFrameViewLinux::GetWindowMask(const gfx::Size& size,
SkPath* window_mask) {
// Nothing to do here, as transparency is used for decorations, not masks.
@ -284,12 +286,6 @@ void ClientFrameViewLinux::Layout(PassKey) {
return;
}
bool tiled = tiled_edges().top || tiled_edges().left ||
tiled_edges().bottom || tiled_edges().right;
frame_provider_ =
ui::LinuxUiTheme::GetForProfile(nullptr)->GetWindowFrameProvider(
!host_supports_client_frame_shadow_, tiled, frame_->IsMaximized());
UpdateButtonImages();
LayoutButtons();
@ -303,9 +299,9 @@ void ClientFrameViewLinux::Layout(PassKey) {
void ClientFrameViewLinux::OnPaint(gfx::Canvas* canvas) {
if (!frame_->IsFullscreen()) {
frame_provider_->PaintWindowFrame(canvas, GetLocalBounds(),
GetTitlebarBounds().bottom(),
ShouldPaintAsActive(), GetInputInsets());
GetFrameProvider()->PaintWindowFrame(
canvas, GetLocalBounds(), GetTitlebarBounds().bottom(),
ShouldPaintAsActive(), GetInputInsets());
}
}
@ -336,7 +332,8 @@ void ClientFrameViewLinux::UpdateThemeValues() {
gtk_style_context_set_state(button_context, GTK_STATE_FLAG_BACKDROP);
}
theme_values_.window_border_radius = frame_provider_->GetTopCornerRadiusDip();
theme_values_.window_border_radius =
GetFrameProvider()->GetTopCornerRadiusDip();
gtk::GtkStyleContextGet(headerbar_context, "min-height",
&theme_values_.titlebar_min_height, nullptr);

View file

@ -78,9 +78,11 @@ class ClientFrameViewLinux : public FramelessView,
void Layout(PassKey) override;
void OnPaint(gfx::Canvas* canvas) override;
// Overriden from views::ViewTargeterDelegate
// Overridden from views::ViewTargeterDelegate
views::View* TargetForRect(views::View* root, const gfx::Rect& rect) override;
ui::WindowFrameProvider* GetFrameProvider() const;
private:
static constexpr int kNavButtonCount = 4;
@ -137,8 +139,6 @@ class ClientFrameViewLinux : public FramelessView,
bool host_supports_client_frame_shadow_ = false;
raw_ptr<ui::WindowFrameProvider> frame_provider_;
base::ScopedObservation<ui::NativeTheme, ui::NativeThemeObserver>
native_theme_observer_{this};
base::ScopedObservation<ui::LinuxUi, ui::WindowButtonOrderObserver>

View file

@ -161,7 +161,7 @@ base::Value::Dict BuildTargetDescriptor(views::Widget* widget) {
widget_data.Set(kTypeField, kWidget);
// Use the Widget's root view ViewAccessibility's unique ID for lookup.
int id = widget->GetRootView()->GetViewAccessibility().GetUniqueId().Get();
int32_t id = widget->GetRootView()->GetViewAccessibility().GetUniqueId();
widget_data.Set(kWidgetIdField, id);
return widget_data;
}

View file

@ -84,7 +84,7 @@ bool WebContentsZoomController::SetZoomLevel(double level) {
// Do not actually rescale the page in manual mode.
if (zoom_mode_ == ZOOM_MODE_MANUAL) {
// If the zoom level hasn't changed, early out to avoid sending an event.
if (blink::PageZoomValuesEqual(zoom_level_, level))
if (blink::ZoomValuesEqual(zoom_level_, level))
return true;
double old_zoom_level = zoom_level_;
@ -333,7 +333,7 @@ void WebContentsZoomController::RenderFrameHostChanged(
void WebContentsZoomController::SetZoomFactorOnNavigationIfNeeded(
const GURL& url) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (blink::PageZoomValuesEqual(default_zoom_factor(), kPageZoomEpsilon))
if (blink::ZoomValuesEqual(default_zoom_factor(), kPageZoomEpsilon))
return;
content::GlobalRenderFrameHostId old_rfh_id_ =
@ -357,11 +357,11 @@ void WebContentsZoomController::SetZoomFactorOnNavigationIfNeeded(
std::string host = net::GetHostOrSpecFromURL(url);
std::string scheme = url.scheme();
double zoom_factor = default_zoom_factor();
double zoom_level = blink::PageZoomFactorToZoomLevel(zoom_factor);
double zoom_level = blink::ZoomFactorToZoomLevel(zoom_factor);
if (host_zoom_map_->HasZoomLevel(scheme, host)) {
zoom_level = host_zoom_map_->GetZoomLevelForHostAndScheme(scheme, host);
}
if (blink::PageZoomValuesEqual(zoom_level, GetZoomLevel()))
if (blink::ZoomValuesEqual(zoom_level, GetZoomLevel()))
return;
SetZoomLevel(zoom_level);

View file

@ -76,13 +76,13 @@ void WebViewGuestDelegate::OnZoomChanged(
if (data.temporary) {
zoom_controller->SetTemporaryZoomLevel(data.new_zoom_level);
} else {
if (blink::PageZoomValuesEqual(data.new_zoom_level,
zoom_controller->GetZoomLevel()))
if (blink::ZoomValuesEqual(data.new_zoom_level,
zoom_controller->GetZoomLevel()))
return;
zoom_controller->SetZoomLevel(data.new_zoom_level);
}
// Change the default zoom factor to match the embedders' new zoom level.
double zoom_factor = blink::PageZoomLevelToZoomFactor(data.new_zoom_level);
double zoom_factor = blink::ZoomLevelToZoomFactor(data.new_zoom_level);
zoom_controller->SetDefaultZoomFactor(zoom_factor);
}
}

View file

@ -53,7 +53,7 @@ ZoomLevelDelegate::ZoomLevelDelegate(PrefService* pref_service,
ZoomLevelDelegate::~ZoomLevelDelegate() = default;
void ZoomLevelDelegate::SetDefaultZoomLevelPref(double level) {
if (blink::PageZoomValuesEqual(level, host_zoom_map_->GetDefaultZoomLevel()))
if (blink::ZoomValuesEqual(level, host_zoom_map_->GetDefaultZoomLevel()))
return;
ScopedDictPrefUpdate update(pref_service_, kPartitionDefaultZoomLevel);
@ -79,7 +79,7 @@ void ZoomLevelDelegate::OnZoomLevelChanged(
base::Value::Dict& host_zoom_dictionaries = update.Get();
bool modification_is_removal =
blink::PageZoomValuesEqual(level, host_zoom_map_->GetDefaultZoomLevel());
blink::ZoomValuesEqual(level, host_zoom_map_->GetDefaultZoomLevel());
base::Value::Dict* host_zoom_dictionary =
host_zoom_dictionaries.FindDict(partition_key_);
@ -109,8 +109,8 @@ void ZoomLevelDelegate::ExtractPerHostZoomLevels(
// will ignore type B values, thus, to have consistency with HostZoomMap's
// internal state, these values must also be removed from Prefs.
if (host.empty() || !zoom_level.has_value() ||
blink::PageZoomValuesEqual(zoom_level.value(),
host_zoom_map_->GetDefaultZoomLevel())) {
blink::ZoomValuesEqual(zoom_level.value(),
host_zoom_map_->GetDefaultZoomLevel())) {
keys_to_remove.push_back(host);
continue;
}