Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(357)

Unified Diff: content/browser/web_contents/web_contents_view_mac.mm

Issue 869563003: [Mac] Allow vibrancy & transparency on WebContentsView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comment to [WebContentsViewCocoa allowsVibrancy] Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/web_contents/web_contents_view_mac.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_view_mac.mm
diff --git a/content/browser/web_contents/web_contents_view_mac.mm b/content/browser/web_contents/web_contents_view_mac.mm
index 27989c3951ffce334f0a2f48c2db99b67f3695df..1436d3957828439050fc4f38671f5f8cb8d085a8 100644
--- a/content/browser/web_contents/web_contents_view_mac.mm
+++ b/content/browser/web_contents/web_contents_view_mac.mm
@@ -423,6 +423,14 @@ void WebContentsViewMac::CloseTab() {
[super dealloc];
}
+- (BOOL)allowsVibrancy {
+ // Returning YES will allow rendering this view with vibrancy effect if it is
+ // incorporated into a view hierarchy that uses vibrancy, it will have no
+ // effect otherwise.
+ // For details see Apple documentation on NSView and NSVisualEffectView.
+ return YES;
+}
+
// Registers for the view for the appropriate drag types.
- (void)registerDragTypes {
NSArray* types = [NSArray arrayWithObjects:
@@ -479,6 +487,13 @@ void WebContentsViewMac::CloseTab() {
return mouseDownCanMoveWindow_;
}
+- (void)setOpaque:(BOOL)opaque {
+ RenderWidgetHostViewMac* view = static_cast<RenderWidgetHostViewMac*>(
+ webContentsView_->web_contents()->GetRenderWidgetHostView());
+ DCHECK(view);
+ [view->cocoa_view() setOpaque:opaque];
+}
+
- (void)pasteboard:(NSPasteboard*)sender provideDataForType:(NSString*)type {
[dragSource_ lazyWriteToPasteboard:sender
forType:type];
« no previous file with comments | « content/browser/web_contents/web_contents_view_mac.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698