Remove redundant ui/gfx header file references

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

← Back to List

Remove redundant ui/gfx header file references

Minor
Commit Hash: cd98c2e633838641fa69d48c42aff0d0760d33da
Commit Time: 2025-05-19 18:59:38+00:00
Impact Level: Minor
Generated By: webview2-upstream-sentry
Upstream Review: View Upstream Review 🔗

📋 Summary

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.

🎯 Impact Analysis

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.

Impacted Classes:

AlertBridge MenuControllerCocoaDelegateImpl