Migrate Screen::GetScreen() to Screen::Get()

Commit: 24a2f153 | 2025-08-20 07:07:36+00:00

← Back to List

Migrate Screen::GetScreen() to Screen::Get()

Minor
Commit Hash: 24a2f153e17c67705a279bf0a12b9b3681932573
Commit Time: 2025-08-20 07:07:36+00:00
Impact Level: Minor
Generated By: webview2-upstream-sentry
Upstream Review: View Upstream Review 🔗

📋 Summary

This submission replaces all instances of display::Screen::GetScreen() with display::Screen::Get() in the //components directory. This is a simple function renaming; the functionality remains exactly the same, but uses a shorter name. The affected files include autofill, constrained window, DOM distiller, color picker, screen info metrics provider, payment icon size, and two remote_cocoa files: immersive_mode_controller_cocoa.mm and native_widget_ns_window_bridge.mm.

🎯 Impact Analysis

This change has minimal impact on WebView2Mac. It is a purely API renaming and does not alter any functional behavior. In two key remote_cocoa files: 1) In immersive_mode_controller_cocoa.mm, the display_observation_.Observe() call is changed from observing display::Screen::GetScreen() to observing display::Screen::Get(), which does not affect the behavior of monitoring display changes; 2) In native_widget_ns_window_bridge.mm, the screen acquisition calls in the GetDisplayForWindow() function and the FullscreenControllerGetFrameForDisplay() method are updated, but the returned display::Display objects and related logic remain unchanged. All remote_cocoa window management, fullscreen control, and display detection functionalities relied upon by WebView2Mac will not be substantively affected.

Impacted Classes:

ImmersiveModeControllerCocoa NativeWidgetNSWindowBridge