Commit 03ce3cd7 authored by shess@chromium.org's avatar shess@chromium.org

Make converting from NativeViewId to NativeView an error on Mac.

Goal is to prevent someone from checking in new cross-platform code relying on this.

Review URL: http://codereview.chromium.org/149342

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20193 0039d316-1c4b-4281-b951-d872f2087c98
parent ef916278
...@@ -89,10 +89,19 @@ typedef intptr_t NativeViewId; ...@@ -89,10 +89,19 @@ typedef intptr_t NativeViewId;
// On Windows, these are both HWNDS so it's just a cast. // 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 Mac, for now, we pass the NSView pointer into the renderer
// On Linux we use an opaque id // On Linux we use an opaque id
#if defined(OS_WIN) || defined(OS_MACOSX) #if defined(OS_WIN)
static inline NativeView NativeViewFromId(NativeViewId id) { static inline NativeView NativeViewFromId(NativeViewId id) {
return reinterpret_cast<NativeView>(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) #elif defined(OS_LINUX)
// A NativeView on Linux is a GtkWidget*. However, we can't go directly from an // 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 // X window ID to a GtkWidget. Thus, functions which handle NativeViewIds from
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment