[GlowUp] Implement glass frame behind a flag
Minor
提交哈希:
472377f010ecda806f8333f4fe5c813a0f6f110d
提交时间: 2026-04-17 17:46:42
影响等级: Minor
生成工具: chromium-watcher
上游审核链接:
查看上游审核 🔗
📋 摘要
This commit adds a new kGlassFrame feature flag (disabled by default) for macOS Chrome browser to implement a glass transparency effect on the browser frame. Key changes include:
1. Defining a new kGlassFrame feature flag in ui/base/ui_base_features (Mac-only)
2. Setting NSWindow as transparent in BrowserNativeWidgetMac and adding NSVisualEffectView as background
3. Modifying BrowserFrameViewMac painting to use semi-transparent alpha for frame colors
4. Adjusting tab (horizontal and vertical) hover, background painting, and color logic for the glass effect
5. Overriding isOpaque in NativeWidgetMacNSWindow (remote_cocoa component) to return NO when feature is enabled
6. Setting window opacity parameter to kTranslucent in BrowserWidget
1. Defining a new kGlassFrame feature flag in ui/base/ui_base_features (Mac-only)
2. Setting NSWindow as transparent in BrowserNativeWidgetMac and adding NSVisualEffectView as background
3. Modifying BrowserFrameViewMac painting to use semi-transparent alpha for frame colors
4. Adjusting tab (horizontal and vertical) hover, background painting, and color logic for the glass effect
5. Overriding isOpaque in NativeWidgetMacNSWindow (remote_cocoa component) to return NO when feature is enabled
6. Setting window opacity parameter to kTranslucent in BrowserWidget
🎯 影响分析
The impact of this commit on WebView2Mac is minor for the following reasons:
1. The kGlassFrame feature flag is disabled by default, only taking effect when manually enabled via chrome://flags
2. The majority of changes are in Chrome browser UI layer (chrome/browser/ui/views/), covering browser frame, tab strip, and toolbar visual effects — WebView2 does not use these Chrome browser UI components
3. The only remote_cocoa change is the isOpaque override in NativeWidgetMacNSWindow. This is the base NSWindow class used by WebView2's window system, but the override only activates when kGlassFrame is enabled. WebView2's HostingNSWindowBridge uses this window class, so theoretically if the flag were enabled, it could affect window opacity behavior
4. The new OnWidgetInitDone override and NSVisualEffectView creation in BrowserNativeWidgetMac are Chrome browser-specific and do not affect WebView2's window initialization path
5. Watch item: if this feature flag becomes enabled by default in the future, NativeWidgetMacNSWindow.isOpaque returning NO would affect all consumers of this window class, including WebView2 window rendering
1. The kGlassFrame feature flag is disabled by default, only taking effect when manually enabled via chrome://flags
2. The majority of changes are in Chrome browser UI layer (chrome/browser/ui/views/), covering browser frame, tab strip, and toolbar visual effects — WebView2 does not use these Chrome browser UI components
3. The only remote_cocoa change is the isOpaque override in NativeWidgetMacNSWindow. This is the base NSWindow class used by WebView2's window system, but the override only activates when kGlassFrame is enabled. WebView2's HostingNSWindowBridge uses this window class, so theoretically if the flag were enabled, it could affect window opacity behavior
4. The new OnWidgetInitDone override and NSVisualEffectView creation in BrowserNativeWidgetMac are Chrome browser-specific and do not affect WebView2's window initialization path
5. Watch item: if this feature flag becomes enabled by default in the future, NativeWidgetMacNSWindow.isOpaque returning NO would affect all consumers of this window class, including WebView2 window rendering
受影响的类:
NativeWidgetMacNSWindow
BrowserNativeWidgetMac
BrowserFrameViewMac