mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
chore: bump chromium to 102.0.4989.0 (19-x-y) (#33556)
* chore: bump chromium in DEPS to 102.0.4975.0 * chore: bump chromium in DEPS to 102.0.4977.0 * chore: bump chromium in DEPS to 102.0.4979.0 * chore: bump chromium in DEPS to 102.0.4981.0 * chore: bump chromium in DEPS to 102.0.4983.0 * chore: bump chromium in DEPS to 102.0.4985.0 * chore: bump chromium in DEPS to 102.0.4987.0 * chore: bump chromium in DEPS to 102.0.4989.0 * chore: bump chromium in DEPS to 102.0.4991.0 * chore: bump chromium in DEPS to 102.0.4993.0 * chore: bump chromium in DEPS to 102.0.4995.0 * chore: bump chromium in DEPS to 102.0.4997.0 * chore: bump chromium in DEPS to 102.0.4999.0 * chore: bump chromium in DEPS to 102.0.5001.0 * chore: bump chromium in DEPS to 102.0.5003.0 * chore: bump chromium in DEPS to 102.0.5005.0 * chore: bump chromium in DEPS to 102.0.5005.3 * chore: bump chromium to 102.0.4989.0 (main) (#33557) * chore: bump chromium in DEPS to 102.0.4975.0 * chore: bump chromium in DEPS to 102.0.4977.0 * chore: update patches * Remove parameter of OnGpuProcessCrashed() https://chromium-review.googlesource.com/c/chromium/src/+/3543396 * hid: Add exclusionFilters option to requestDevice https://chromium-review.googlesource.com/c/chromium/src/+/3478175 * chore: bump chromium in DEPS to 102.0.4979.0 * chore: bump chromium in DEPS to 102.0.4981.0 * chore: update patches * Deny notification/push permission for documents in non-standard StoragePartitions https://chromium-review.googlesource.com/c/chromium/src/+/3257305 * Improve FrameTreeNode tracking in URLLoaderNetworkContext https://chromium-review.googlesource.com/c/chromium/src/+/3341866 * fixup! Remove parameter of OnGpuProcessCrashed() * chore: fix lint * Reland "Use gfx::Insets[F]::TLBR() and gfx::Insets[F]::VH() in the rest of Chrome" https://chromium-review.googlesource.com/c/chromium/src/+/3554236 * chore: bump chromium in DEPS to 102.0.4983.0 * Ensure EyeDropperView does not access a destroyed window https://chromium-review.googlesource.com/c/chromium/src/+/3561542 * ci: don't delete dawn .git directory 83901: Adds a generated file with the dawn git hash encoded at build time. | https://dawn-review.googlesource.com/c/dawn/+/83901 * ci: update Windows toolchain 3550827: New toolchain for Windows 10 20348 SDK | https://chromium-review.googlesource.com/c/chromium/src/+/3550827 * chore: bump chromium in DEPS to 102.0.4985.0 * chore: update patches * chore: bump chromium in DEPS to 102.0.4987.0 * chore: update patches * 3563432: codehealth: remove uses of DictionaryValue in cbui/webui https://chromium-review.googlesource.com/c/chromium/src/+/3563432 * chore: update patches after rebase * Use gfx::Insets[F]::TLBR() and gfx::Insets[F]::VH() in the rest of Chrome https://chromium-review.googlesource.com/c/chromium/src/+/3554236 * 3565724: Preserve "proper method names" as-is in error.stack. https://chromium-review.googlesource.com/c/v8/v8/+/3565724 * chore: bump chromium in DEPS to 102.0.4989.0 * chore: update patches * fixup ci: don't delete dawn .git directory for Windows * 3560843: Remove multi-parameter version of gfx::Rect[F]::Inset() https://chromium-review.googlesource.com/c/chromium/src/+/3560843 * 3572711: Remove unused IDS_PDF_TOOLTIP_ROTATE_CW resource. https://chromium-review.googlesource.com/c/chromium/src/+/3572711 * 3572926: Reland "[Sysroot] Switch to Debian Bullseye stable" https://chromium-review.googlesource.com/c/chromium/src/+/3572926 * build: fixup sysroots with electron specific dependencies * fixup Remove multi-parameter version of gfx::Rect[F]::Inset() * fixup 3565724: Preserve "proper method names" as-is in error.stack. * fixup Remove multi-parameter version of gfx::Rect[F]::Inset() * test: add spec for navigator.hid.requestDevice({ exclusionFilters: [...] } * fixup 3565724: Preserve "proper method names" as-is in error.stack. * ci: use python3 to get the windows toolchain profile 3525960: Explicitly run everything with python3 | https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3525960 * chore: add diagnostic logging * fix: try calling process.crash() * chore: remove logging Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: deepak1556 <hop2deep@gmail.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> (cherry picked from commit59dd17f2cf) * chore: update patches after rebase * chore: bump chromium in DEPS to 102.0.5005.3 * Revert "chore: bump chromium in DEPS to 102.0.5005.3" This reverts commit958cfb2aff. 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:
committed by
GitHub
parent
5ede2aefe7
commit
cfd9825bc2
@@ -881,9 +881,8 @@ void App::OnGpuInfoUpdate() {
|
||||
Emit("gpu-info-update");
|
||||
}
|
||||
|
||||
void App::OnGpuProcessCrashed(base::TerminationStatus status) {
|
||||
Emit("gpu-process-crashed",
|
||||
status == base::TERMINATION_STATUS_PROCESS_WAS_KILLED);
|
||||
void App::OnGpuProcessCrashed() {
|
||||
Emit("gpu-process-crashed", true);
|
||||
}
|
||||
|
||||
void App::BrowserChildProcessLaunchedAndConnected(
|
||||
|
||||
@@ -153,7 +153,7 @@ class App : public ElectronBrowserClient::Delegate,
|
||||
|
||||
// content::GpuDataManagerObserver:
|
||||
void OnGpuInfoUpdate() override;
|
||||
void OnGpuProcessCrashed(base::TerminationStatus status) override;
|
||||
void OnGpuProcessCrashed() override;
|
||||
|
||||
// content::BrowserChildProcessObserver:
|
||||
void BrowserChildProcessLaunchedAndConnected(
|
||||
|
||||
@@ -348,8 +348,6 @@ ElectronBrowserContext::GetURLLoaderFactory() {
|
||||
params->disable_web_security = false;
|
||||
|
||||
auto* storage_partition = GetDefaultStoragePartition();
|
||||
params->url_loader_network_observer =
|
||||
storage_partition->CreateURLLoaderNetworkObserverForNavigationRequest(-1);
|
||||
storage_partition->GetNetworkContext()->CreateURLLoaderFactory(
|
||||
std::move(factory_receiver), std::move(params));
|
||||
url_loader_factory_ =
|
||||
|
||||
@@ -253,6 +253,7 @@ blink::mojom::PermissionStatus ElectronPermissionManager::GetPermissionStatus(
|
||||
ElectronPermissionManager::SubscriptionId
|
||||
ElectronPermissionManager::SubscribePermissionStatusChange(
|
||||
content::PermissionType permission,
|
||||
content::RenderProcessHost* render_process_host,
|
||||
content::RenderFrameHost* render_frame_host,
|
||||
const GURL& requesting_origin,
|
||||
base::RepeatingCallback<void(blink::mojom::PermissionStatus)> callback) {
|
||||
@@ -408,4 +409,12 @@ ElectronPermissionManager::GetPermissionStatusForCurrentDocument(
|
||||
content::PermissionUtil::GetLastCommittedOriginAsURL(render_frame_host));
|
||||
}
|
||||
|
||||
blink::mojom::PermissionStatus
|
||||
ElectronPermissionManager::GetPermissionStatusForWorker(
|
||||
content::PermissionType permission,
|
||||
content::RenderProcessHost* render_process_host,
|
||||
const GURL& worker_origin) {
|
||||
return GetPermissionStatus(permission, worker_origin, worker_origin);
|
||||
}
|
||||
|
||||
} // namespace electron
|
||||
|
||||
@@ -117,8 +117,13 @@ class ElectronPermissionManager : public content::PermissionControllerDelegate {
|
||||
content::PermissionType permission,
|
||||
const GURL& requesting_origin,
|
||||
const GURL& embedding_origin) override;
|
||||
blink::mojom::PermissionStatus GetPermissionStatusForWorker(
|
||||
content::PermissionType permission,
|
||||
content::RenderProcessHost* render_process_host,
|
||||
const GURL& worker_origin) override;
|
||||
SubscriptionId SubscribePermissionStatusChange(
|
||||
content::PermissionType permission,
|
||||
content::RenderProcessHost* render_process_host,
|
||||
content::RenderFrameHost* render_frame_host,
|
||||
const GURL& requesting_origin,
|
||||
base::RepeatingCallback<void(blink::mojom::PermissionStatus)> callback)
|
||||
|
||||
@@ -47,7 +47,6 @@ void AddStringsForPdf(base::DictionaryValue* dict) {
|
||||
{"pageReload", IDS_PDF_PAGE_RELOAD_BUTTON},
|
||||
{"bookmarks", IDS_PDF_BOOKMARKS},
|
||||
{"labelPageNumber", IDS_PDF_LABEL_PAGE_NUMBER},
|
||||
{"tooltipRotateCW", IDS_PDF_TOOLTIP_ROTATE_CW},
|
||||
{"tooltipDownload", IDS_PDF_TOOLTIP_DOWNLOAD},
|
||||
{"tooltipPrint", IDS_PDF_TOOLTIP_PRINT},
|
||||
{"tooltipFitToPage", IDS_PDF_TOOLTIP_FIT_PAGE},
|
||||
|
||||
@@ -39,8 +39,8 @@ ElectronComponentExtensionResourceManager::
|
||||
pdf_extension_util::AddAdditionalData(true, &pdf_strings);
|
||||
|
||||
ui::TemplateReplacements pdf_viewer_replacements;
|
||||
ui::TemplateReplacementsFromDictionaryValue(
|
||||
base::Value::AsDictionaryValue(pdf_strings), &pdf_viewer_replacements);
|
||||
ui::TemplateReplacementsFromDictionaryValue(pdf_strings.GetDict(),
|
||||
&pdf_viewer_replacements);
|
||||
extension_template_replacements_[extension_misc::kPdfExtensionId] =
|
||||
std::move(pdf_viewer_replacements);
|
||||
#endif
|
||||
|
||||
@@ -36,6 +36,7 @@ ElectronHidDelegate::~ElectronHidDelegate() = default;
|
||||
std::unique_ptr<content::HidChooser> ElectronHidDelegate::RunChooser(
|
||||
content::RenderFrameHost* render_frame_host,
|
||||
std::vector<blink::mojom::HidDeviceFilterPtr> filters,
|
||||
std::vector<blink::mojom::HidDeviceFilterPtr> exclusion_filters,
|
||||
content::HidChooser::Callback callback) {
|
||||
electron::HidChooserContext* chooser_context =
|
||||
GetChooserContext(render_frame_host);
|
||||
@@ -47,7 +48,7 @@ std::unique_ptr<content::HidChooser> ElectronHidDelegate::RunChooser(
|
||||
DeleteControllerForFrame(render_frame_host);
|
||||
}
|
||||
AddControllerForFrame(render_frame_host, std::move(filters),
|
||||
std::move(callback));
|
||||
std::move(exclusion_filters), std::move(callback));
|
||||
|
||||
// Return a nullptr because the return value isn't used for anything, eg
|
||||
// there is no mechanism to cancel navigator.hid.requestDevice(). The return
|
||||
@@ -156,12 +157,13 @@ HidChooserController* ElectronHidDelegate::ControllerForFrame(
|
||||
HidChooserController* ElectronHidDelegate::AddControllerForFrame(
|
||||
content::RenderFrameHost* render_frame_host,
|
||||
std::vector<blink::mojom::HidDeviceFilterPtr> filters,
|
||||
std::vector<blink::mojom::HidDeviceFilterPtr> exclusion_filters,
|
||||
content::HidChooser::Callback callback) {
|
||||
auto* web_contents =
|
||||
content::WebContents::FromRenderFrameHost(render_frame_host);
|
||||
auto controller = std::make_unique<HidChooserController>(
|
||||
render_frame_host, std::move(filters), std::move(callback), web_contents,
|
||||
weak_factory_.GetWeakPtr());
|
||||
render_frame_host, std::move(filters), std::move(exclusion_filters),
|
||||
std::move(callback), web_contents, weak_factory_.GetWeakPtr());
|
||||
controller_map_.insert(
|
||||
std::make_pair(render_frame_host, std::move(controller)));
|
||||
return ControllerForFrame(render_frame_host);
|
||||
|
||||
@@ -31,6 +31,7 @@ class ElectronHidDelegate : public content::HidDelegate,
|
||||
std::unique_ptr<content::HidChooser> RunChooser(
|
||||
content::RenderFrameHost* render_frame_host,
|
||||
std::vector<blink::mojom::HidDeviceFilterPtr> filters,
|
||||
std::vector<blink::mojom::HidDeviceFilterPtr> exclusion_filters,
|
||||
content::HidChooser::Callback callback) override;
|
||||
bool CanRequestDevicePermission(
|
||||
content::RenderFrameHost* render_frame_host) override;
|
||||
@@ -67,6 +68,7 @@ class ElectronHidDelegate : public content::HidDelegate,
|
||||
HidChooserController* AddControllerForFrame(
|
||||
content::RenderFrameHost* render_frame_host,
|
||||
std::vector<blink::mojom::HidDeviceFilterPtr> filters,
|
||||
std::vector<blink::mojom::HidDeviceFilterPtr> exclusion_filters,
|
||||
content::HidChooser::Callback callback);
|
||||
|
||||
base::ScopedObservation<HidChooserContext,
|
||||
|
||||
@@ -40,6 +40,47 @@ std::string PhysicalDeviceIdFromDeviceInfo(
|
||||
: device.physical_device_id;
|
||||
}
|
||||
|
||||
bool FilterMatch(const blink::mojom::HidDeviceFilterPtr& filter,
|
||||
const device::mojom::HidDeviceInfo& device) {
|
||||
if (filter->device_ids) {
|
||||
if (filter->device_ids->is_vendor()) {
|
||||
if (filter->device_ids->get_vendor() != device.vendor_id)
|
||||
return false;
|
||||
} else if (filter->device_ids->is_vendor_and_product()) {
|
||||
const auto& vendor_and_product =
|
||||
filter->device_ids->get_vendor_and_product();
|
||||
if (vendor_and_product->vendor != device.vendor_id)
|
||||
return false;
|
||||
if (vendor_and_product->product != device.product_id)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (filter->usage) {
|
||||
if (filter->usage->is_page()) {
|
||||
const uint16_t usage_page = filter->usage->get_page();
|
||||
auto find_it =
|
||||
std::find_if(device.collections.begin(), device.collections.end(),
|
||||
[=](const device::mojom::HidCollectionInfoPtr& c) {
|
||||
return usage_page == c->usage->usage_page;
|
||||
});
|
||||
if (find_it == device.collections.end())
|
||||
return false;
|
||||
} else if (filter->usage->is_usage_and_page()) {
|
||||
const auto& usage_and_page = filter->usage->get_usage_and_page();
|
||||
auto find_it = std::find_if(
|
||||
device.collections.begin(), device.collections.end(),
|
||||
[&usage_and_page](const device::mojom::HidCollectionInfoPtr& c) {
|
||||
return usage_and_page->usage_page == c->usage->usage_page &&
|
||||
usage_and_page->usage == c->usage->usage;
|
||||
});
|
||||
if (find_it == device.collections.end())
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
namespace gin {
|
||||
@@ -62,11 +103,13 @@ namespace electron {
|
||||
HidChooserController::HidChooserController(
|
||||
content::RenderFrameHost* render_frame_host,
|
||||
std::vector<blink::mojom::HidDeviceFilterPtr> filters,
|
||||
std::vector<blink::mojom::HidDeviceFilterPtr> exclusion_filters,
|
||||
content::HidChooser::Callback callback,
|
||||
content::WebContents* web_contents,
|
||||
base::WeakPtr<ElectronHidDelegate> hid_delegate)
|
||||
: WebContentsObserver(web_contents),
|
||||
filters_(std::move(filters)),
|
||||
exclusion_filters_(std::move(exclusion_filters)),
|
||||
callback_(std::move(callback)),
|
||||
origin_(content::WebContents::FromRenderFrameHost(render_frame_host)
|
||||
->GetMainFrame()
|
||||
@@ -251,7 +294,7 @@ bool HidChooserController::DisplayDevice(
|
||||
return false;
|
||||
}
|
||||
|
||||
return FilterMatchesAny(device);
|
||||
return FilterMatchesAny(device) && !IsExcluded(device);
|
||||
}
|
||||
|
||||
bool HidChooserController::FilterMatchesAny(
|
||||
@@ -260,44 +303,18 @@ bool HidChooserController::FilterMatchesAny(
|
||||
return true;
|
||||
|
||||
for (const auto& filter : filters_) {
|
||||
if (filter->device_ids) {
|
||||
if (filter->device_ids->is_vendor()) {
|
||||
if (filter->device_ids->get_vendor() != device.vendor_id)
|
||||
continue;
|
||||
} else if (filter->device_ids->is_vendor_and_product()) {
|
||||
const auto& vendor_and_product =
|
||||
filter->device_ids->get_vendor_and_product();
|
||||
if (vendor_and_product->vendor != device.vendor_id)
|
||||
continue;
|
||||
if (vendor_and_product->product != device.product_id)
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (FilterMatch(filter, device))
|
||||
return true;
|
||||
}
|
||||
|
||||
if (filter->usage) {
|
||||
if (filter->usage->is_page()) {
|
||||
const uint16_t usage_page = filter->usage->get_page();
|
||||
auto find_it =
|
||||
std::find_if(device.collections.begin(), device.collections.end(),
|
||||
[=](const device::mojom::HidCollectionInfoPtr& c) {
|
||||
return usage_page == c->usage->usage_page;
|
||||
});
|
||||
if (find_it == device.collections.end())
|
||||
continue;
|
||||
} else if (filter->usage->is_usage_and_page()) {
|
||||
const auto& usage_and_page = filter->usage->get_usage_and_page();
|
||||
auto find_it = std::find_if(
|
||||
device.collections.begin(), device.collections.end(),
|
||||
[&usage_and_page](const device::mojom::HidCollectionInfoPtr& c) {
|
||||
return usage_and_page->usage_page == c->usage->usage_page &&
|
||||
usage_and_page->usage == c->usage->usage;
|
||||
});
|
||||
if (find_it == device.collections.end())
|
||||
continue;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
bool HidChooserController::IsExcluded(
|
||||
const device::mojom::HidDeviceInfo& device) const {
|
||||
for (const auto& exclusion_filter : exclusion_filters_) {
|
||||
if (FilterMatch(exclusion_filter, device))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -42,11 +42,13 @@ class HidChooserController
|
||||
// is closed, either by selecting an item or by dismissing the chooser dialog.
|
||||
// The callback is called with the selected device, or nullptr if no device is
|
||||
// selected.
|
||||
HidChooserController(content::RenderFrameHost* render_frame_host,
|
||||
std::vector<blink::mojom::HidDeviceFilterPtr> filters,
|
||||
content::HidChooser::Callback callback,
|
||||
content::WebContents* web_contents,
|
||||
base::WeakPtr<ElectronHidDelegate> hid_delegate);
|
||||
HidChooserController(
|
||||
content::RenderFrameHost* render_frame_host,
|
||||
std::vector<blink::mojom::HidDeviceFilterPtr> filters,
|
||||
std::vector<blink::mojom::HidDeviceFilterPtr> exclusion_filters,
|
||||
content::HidChooser::Callback callback,
|
||||
content::WebContents* web_contents,
|
||||
base::WeakPtr<ElectronHidDelegate> hid_delegate);
|
||||
HidChooserController(HidChooserController&) = delete;
|
||||
HidChooserController& operator=(HidChooserController&) = delete;
|
||||
~HidChooserController() override;
|
||||
@@ -68,6 +70,7 @@ class HidChooserController
|
||||
void OnGotDevices(std::vector<device::mojom::HidDeviceInfoPtr> devices);
|
||||
bool DisplayDevice(const device::mojom::HidDeviceInfo& device) const;
|
||||
bool FilterMatchesAny(const device::mojom::HidDeviceInfo& device) const;
|
||||
bool IsExcluded(const device::mojom::HidDeviceInfo& device) const;
|
||||
|
||||
// Add |device_info| to |device_map_|. The device is added to the chooser item
|
||||
// representing the physical device. If the chooser item does not yet exist, a
|
||||
@@ -88,6 +91,7 @@ class HidChooserController
|
||||
void OnDeviceChosen(gin::Arguments* args);
|
||||
|
||||
std::vector<blink::mojom::HidDeviceFilterPtr> filters_;
|
||||
std::vector<blink::mojom::HidDeviceFilterPtr> exclusion_filters_;
|
||||
content::HidChooser::Callback callback_;
|
||||
const url::Origin origin_;
|
||||
const int frame_tree_node_id_;
|
||||
|
||||
@@ -148,7 +148,7 @@ void ElectronDesktopWindowTreeHostLinux::UpdateClientDecorationHints(
|
||||
if (showing_frame) {
|
||||
insets = view->GetBorderDecorationInsets();
|
||||
if (base::i18n::IsRTL()) {
|
||||
insets.Set(insets.top(), insets.right(), insets.bottom(), insets.left());
|
||||
insets.set_left_right(insets.right(), insets.left());
|
||||
}
|
||||
|
||||
input_insets = view->GetInputInsets();
|
||||
|
||||
@@ -174,7 +174,7 @@ void AutofillPopupView::DrawAutofillEntry(gfx::Canvas* canvas,
|
||||
const int text_align =
|
||||
is_rtl ? gfx::Canvas::TEXT_ALIGN_RIGHT : gfx::Canvas::TEXT_ALIGN_LEFT;
|
||||
gfx::Rect value_rect = entry_rect;
|
||||
value_rect.Inset(kEndPadding, 0);
|
||||
value_rect.Inset(gfx::Insets::VH(kEndPadding, 0));
|
||||
|
||||
int x_align_left = value_rect.x();
|
||||
const int value_width = gfx::GetStringWidth(
|
||||
|
||||
@@ -178,7 +178,8 @@ gfx::Rect ClientFrameViewLinux::GetBoundsForClientView() const {
|
||||
gfx::Rect client_bounds = bounds();
|
||||
if (!frame_->IsFullscreen()) {
|
||||
client_bounds.Inset(GetBorderDecorationInsets());
|
||||
client_bounds.Inset(0, GetTitlebarBounds().height(), 0, 0);
|
||||
client_bounds.Inset(
|
||||
gfx::Insets::TLBR(0, GetTitlebarBounds().height(), 0, 0));
|
||||
}
|
||||
return client_bounds;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ void WinCaptionButton::OnPaintBackground(gfx::Canvas* canvas) {
|
||||
const SkAlpha theme_alpha = SkColorGetA(bg_color);
|
||||
|
||||
gfx::Rect bounds = GetContentsBounds();
|
||||
bounds.Inset(0, 0, 0, 0);
|
||||
bounds.Inset(gfx::Insets::TLBR(0, 0, 0, 0));
|
||||
|
||||
canvas->FillRect(bounds, SkColorSetA(bg_color, theme_alpha));
|
||||
|
||||
@@ -145,7 +145,7 @@ void DrawRect(gfx::Canvas* canvas,
|
||||
const cc::PaintFlags& flags) {
|
||||
gfx::RectF rect_f(rect);
|
||||
float stroke_half_width = flags.getStrokeWidth() / 2;
|
||||
rect_f.Inset(stroke_half_width, stroke_half_width);
|
||||
rect_f.Inset(gfx::InsetsF::VH(stroke_half_width, stroke_half_width));
|
||||
canvas->DrawRect(rect_f, flags);
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ void WinCaptionButton::PaintSymbol(gfx::Canvas* canvas) {
|
||||
case VIEW_ID_RESTORE_BUTTON: {
|
||||
// Bottom left ("in front") square.
|
||||
const int separation = std::floor(2 * scale);
|
||||
symbol_rect.Inset(0, separation, separation, 0);
|
||||
symbol_rect.Inset(gfx::Insets::TLBR(0, separation, separation, 0));
|
||||
DrawRect(canvas, symbol_rect, flags);
|
||||
|
||||
// Top right ("behind") square.
|
||||
|
||||
@@ -132,7 +132,7 @@ int WinFrameView::NonClientHitTest(const gfx::Point& point) {
|
||||
// show the resize cursor when resizing is possible. The cost of which
|
||||
// is also maybe showing it over the portion of the DIP that isn't the
|
||||
// outermost pixel.
|
||||
buttons.Inset(0, kCaptionButtonTopInset, 0, 0);
|
||||
buttons.Inset(gfx::Insets::TLBR(0, kCaptionButtonTopInset, 0, 0));
|
||||
if (buttons.Contains(point))
|
||||
return HTNOWHERE;
|
||||
}
|
||||
@@ -143,8 +143,8 @@ int WinFrameView::NonClientHitTest(const gfx::Point& point) {
|
||||
// pixels at the end of the top and bottom edges trigger diagonal resizing.
|
||||
constexpr int kResizeCornerWidth = 16;
|
||||
int window_component = GetHTComponentForFrame(
|
||||
point, gfx::Insets(top_border_thickness, 0, 0, 0), top_border_thickness,
|
||||
kResizeCornerWidth - FrameBorderThickness(),
|
||||
point, gfx::Insets::TLBR(top_border_thickness, 0, 0, 0),
|
||||
top_border_thickness, kResizeCornerWidth - FrameBorderThickness(),
|
||||
frame()->widget_delegate()->CanResize());
|
||||
if (window_component != HTNOWHERE)
|
||||
return window_component;
|
||||
|
||||
@@ -93,7 +93,7 @@ bool ElectronDesktopWindowTreeHostWin::GetClientAreaInsets(
|
||||
// monitors with different DPIs before changing this code.
|
||||
const int thickness = ::GetSystemMetrics(SM_CXSIZEFRAME) +
|
||||
::GetSystemMetrics(SM_CXPADDEDBORDER);
|
||||
insets->Set(thickness, thickness, thickness, thickness);
|
||||
*insets = gfx::Insets::TLBR(thickness, thickness, thickness, thickness);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user