Revert removal of window_visibility_ from NativeWidgetNSWindowBridge

提交: 1a425eae | 2026-05-04 21:31:01

← 返回列表

Revert removal of window_visibility_ from NativeWidgetNSWindowBridge

Minor
提交哈希: 1a425eaef6133b70835cdf3313d5e195ec305152
提交时间: 2026-05-04 21:31:01
影响等级: Minor
生成工具: chromium-watcher
上游审核链接: 查看上游审核 🔗

📋 摘要

This commit reverts commit 91a1300a which attempted to remove the window_visible_ member variable from NativeWidgetNSWindowBridge, replacing it with direct calls to [NSWindow isVisible]. The revert was triggered by regression crbug.com/509176636. It restores the window_visible_ member, the window_visible() accessor, the change-detection logic in OnVisibilityChanged(), and the child window visibility checks in NotifyVisibilityChangeDown().

🎯 影响分析

This revert has low impact on WebView2Mac because the Edge downstream (HostingNSWindowBridge) already depends on the window_visible_ member variable. The downstream HostingNSWindowBridge directly accesses window_visible_ in multiple places: visibility synchronization, child window management, and hosting view visibility calculations. This revert restores the interface that downstream already relies on, maintaining upstream-downstream consistency. Had the original removal (91a1300a) been merged downstream, it would have caused compilation failures or visibility state management issues. Since it was reverted promptly, no actual impact is expected. Monitor for a follow-up re-landing of this optimization with the regression fixed.

受影响的类:

remote_cocoa::NativeWidgetNSWindowBridge edge_embedded_browser::HostingNSWindowBridge