Browse Source

6361987: Remove double-declaration with gfx::NativeView and gfx::NativeWindow | https://chromium-review.googlesource.com/c/chromium/src/+/6361987

alice 3 weeks ago
parent
commit
117e11d3bf

+ 1 - 1
shell/browser/native_window.h

@@ -58,7 +58,7 @@ class BrowserView;
 }
 
 #if BUILDFLAG(IS_MAC)
-typedef NSView* NativeWindowHandle;
+typedef gfx::NativeView NativeWindowHandle;
 #else
 typedef gfx::AcceleratedWidget NativeWindowHandle;
 #endif

+ 4 - 4
shell/browser/native_window_mac.mm

@@ -1190,11 +1190,11 @@ void NativeWindowMac::SetParentWindow(NativeWindow* parent) {
 }
 
 gfx::NativeView NativeWindowMac::GetNativeView() const {
-  return [window_ contentView];
+  return gfx::NativeView([window_ contentView]);
 }
 
 gfx::NativeWindow NativeWindowMac::GetNativeWindow() const {
-  return window_;
+  return gfx::NativeWindow(window_);
 }
 
 gfx::AcceleratedWidget NativeWindowMac::GetAcceleratedWidget() const {
@@ -1217,7 +1217,7 @@ content::DesktopMediaID NativeWindowMac::GetDesktopMediaID() const {
 }
 
 NativeWindowHandle NativeWindowMac::GetNativeWindowHandle() const {
-  return [window_ contentView];
+  return GetNativeView();
 }
 
 void NativeWindowMac::SetProgressBar(double progress,
@@ -1448,7 +1448,7 @@ void NativeWindowMac::SetVibrancy(const std::string& type, int duration) {
       // other views.
       vibrant_native_view_host_ = rootView->AddChildViewAt(
           std::make_unique<views::NativeViewHost>(), 0);
-      vibrant_native_view_host_->Attach(vibrantView);
+      vibrant_native_view_host_->Attach(gfx::NativeView(vibrantView));
 
       rootView->DeprecatedLayoutImmediately();
 

+ 3 - 3
shell/browser/osr/osr_web_contents_view_mac.mm

@@ -31,15 +31,15 @@
 namespace electron {
 
 gfx::NativeView OffScreenWebContentsView::GetNativeView() const {
-  return offScreenView_;
+  return gfx::NativeView(offScreenView_);
 }
 
 gfx::NativeView OffScreenWebContentsView::GetContentNativeView() const {
-  return offScreenView_;
+  return gfx::NativeView(offScreenView_);
 }
 
 gfx::NativeWindow OffScreenWebContentsView::GetTopLevelNativeWindow() const {
-  return [offScreenView_ window];
+  return gfx::NativeWindow([offScreenView_ window]);
 }
 
 void OffScreenWebContentsView::PlatformCreate() {