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

Unified Diff: base/gfx/native_widget_types.h

Issue 149342: Make converting from NativeViewId to NativeView an error on Mac. (Closed)
Patch Set: Typo. Created 11 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/gfx/native_widget_types.h
diff --git a/base/gfx/native_widget_types.h b/base/gfx/native_widget_types.h
index bec33130766f3e9744e840289bf4a8ef63fd64c5..d165cd4abf69cf529885c8d49101e0e2ba76db20 100644
--- a/base/gfx/native_widget_types.h
+++ b/base/gfx/native_widget_types.h
@@ -89,10 +89,19 @@ typedef intptr_t NativeViewId;
// On Windows, these are both HWNDS so it's just a cast.
// On Mac, for now, we pass the NSView pointer into the renderer
// On Linux we use an opaque id
-#if defined(OS_WIN) || defined(OS_MACOSX)
+#if defined(OS_WIN)
static inline NativeView NativeViewFromId(NativeViewId id) {
return reinterpret_cast<NativeView>(id);
}
+#elif defined(OS_MACOSX)
+
+// A recent CL removed the need for Mac to actually convert
+// NativeViewId to NativeView. Until other platforms make changes,
+// the platform-independent code cannot be removed. The following is
+// to discourage new platform-independent uses.
+
+#define NativeViewFromId(x) NATIVE_VIEW_FROM_ID_NOT_AVAILABLE_ON_MAC
+
#elif defined(OS_LINUX)
// A NativeView on Linux is a GtkWidget*. However, we can't go directly from an
// X window ID to a GtkWidget. Thus, functions which handle NativeViewIds from
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698