POSIX: gfx::NativeViewId and CrossProcessEvent

Create a couple new typedefs for porting work. Firstly,
gfx::NativeViewId is a handle to a platform specific widget in the
renderer process. For Windows, this is just a HWND as before. However,
in other platforms the ids used in the renderer process will be
something else.

CrossProcessEvent is the type of a HANDLE to a Windows event object
which is used across processes. Since we aren't going to support these
sorts of events on non-Windows platforms, this will have to go away at
some point. For now, however, this lets us build code without too many
ifdefs all over the place.

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


git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8756 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/webkit/glue/chromium_bridge_impl.cc b/webkit/glue/chromium_bridge_impl.cc
index 680ae9e..4780fa6 100644
--- a/webkit/glue/chromium_bridge_impl.cc
+++ b/webkit/glue/chromium_bridge_impl.cc
@@ -62,14 +62,10 @@
 
 namespace {
 
-gfx::NativeView ToPlatform(WebCore::Widget* widget) {
+gfx::NativeViewId ToNativeId(WebCore::Widget* widget) {
   if (!widget)
     return 0;
-  PlatformWidget widget_id = widget->root()->hostWindow()->platformWindow();
-  // TODO(eseidel): This cast is a hack.  We should replace gfx::NativeView with
-  // something more abstract like PlatformWidget since webkit/glue should not
-  // know about actual native widgets.
-  return static_cast<gfx::NativeView>(widget_id);
+  return widget->root()->hostWindow()->platformWindow();
 }
 
 #if PLATFORM(WIN_OS)
@@ -433,25 +429,25 @@
 // Screen ---------------------------------------------------------------------
 
 int ChromiumBridge::screenDepth(Widget* widget) {
-  return webkit_glue::GetScreenInfo(ToPlatform(widget)).depth;
+  return webkit_glue::GetScreenInfo(ToNativeId(widget)).depth;
 }
 
 int ChromiumBridge::screenDepthPerComponent(Widget* widget) {
-  return webkit_glue::GetScreenInfo(ToPlatform(widget)).depth_per_component;
+  return webkit_glue::GetScreenInfo(ToNativeId(widget)).depth_per_component;
 }
 
 bool ChromiumBridge::screenIsMonochrome(Widget* widget) {
-  return webkit_glue::GetScreenInfo(ToPlatform(widget)).is_monochrome;
+  return webkit_glue::GetScreenInfo(ToNativeId(widget)).is_monochrome;
 }
 
 IntRect ChromiumBridge::screenRect(Widget* widget) {
   return webkit_glue::ToIntRect(
-      webkit_glue::GetScreenInfo(ToPlatform(widget)).rect);
+      webkit_glue::GetScreenInfo(ToNativeId(widget)).rect);
 }
 
 IntRect ChromiumBridge::screenAvailableRect(Widget* widget) {
   return webkit_glue::ToIntRect(
-      webkit_glue::GetScreenInfo(ToPlatform(widget)).available_rect);
+      webkit_glue::GetScreenInfo(ToNativeId(widget)).available_rect);
 }
 
 // SharedTimers ----------------------------------------------------------------