Remove redundant ui/gfx header file references

提交: cd98c2e6 | 2025-05-19 18:59:38+00:00

← 返回列表

Remove redundant ui/gfx header file references

Minor
提交哈希: cd98c2e633838641fa69d48c42aff0d0760d33da
提交时间: 2025-05-19 18:59:38+00:00
影响等级: Minor
生成工具: webview2-upstream-sentry
上游审核链接: 查看上游审核 🔗

📋 摘要

This submission primarily cleans up unnecessary ui/gfx-related header file inclusions in multiple header files under the components directory. The change is based on the following principle: ui/gfx code uses the gfx namespace; if "gfx::" does not appear in a header file, there is no need to include the corresponding ui/gfx header file. The affected remote_cocoa-related files include: moving the inclusion of ui/gfx/text_elider.h from alert.h to the alert.mm implementation file, and removing the inclusion of ui/gfx/font.h from menu_controller_cocoa_delegate_impl.h. A total of 23 files are affected, with 27 redundant header file inclusions removed and 1 necessary header file inclusion added.

🎯 影响分析

This change has minimal impact on WebView2Mac. The main modifications focus on code organization optimization, improving compilation efficiency and code cleanliness by removing unnecessary header file references. Specifically, for changes in the remote_cocoa module: 1) The changes to alert.h/alert.mm only involve adjustments to header file reference locations; the gfx::TruncateString functionality remains available and does not affect the text truncation feature of alert dialogs; 2) The removal of ui/gfx/font.h from menu_controller_cocoa_delegate_impl.h indicates that font-related functionality from this header is not actually required. Since Remote Cocoa in WebView2Mac is primarily responsible for NSWindow and NSView hosting, and these changes are purely code cleanups rather than functional modifications, they will not affect web content rendering, user interaction handling, or the integration between WebView2Mac and the host application. Compilation performance may see a slight improvement.

受影响的类:

AlertBridge MenuControllerCocoaDelegateImpl