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

Unified Diff: ui/gfx/native_widget_types.h

Issue 7741001: Add Aura support to views: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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 | « build/common.gypi ('k') | views/controls/menu/menu_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/native_widget_types.h
===================================================================
--- ui/gfx/native_widget_types.h (revision 98084)
+++ ui/gfx/native_widget_types.h (working copy)
@@ -36,6 +36,9 @@
// 'views' and with our Chrome UI code where the elements are also called
// 'views'.
+#if defined(USE_AURA)
+#include "aura/window.h"
+#endif
#if defined(OS_WIN)
#include <windows.h> // NOLINT
typedef struct HFONT__* HFONT;
@@ -80,10 +83,25 @@
namespace gfx {
+#if defined(USE_AURA)
+typedef aura::Window* NativeView;
+typedef aura::Window* NativeWindow;
+#elif defined(OS_WIN)
+typedef HWND NativeView;
+typedef HWND NativeWindow;
+#elif defined(OS_MACOSX)
+typedef NSView* NativeView;
+typedef NSWindow* NativeWindow;
+#elif defined(USE_WAYLAND)
+typedef ui::WaylandWindow* NativeView;
+typedef ui::WaylandWindow* NativeWindow;
+#elif defined(USE_X11)
+typedef GtkWidget* NativeView;
+typedef GtkWindow* NativeWindow;
+#endif
+
#if defined(OS_WIN)
typedef HFONT NativeFont;
-typedef HWND NativeView;
-typedef HWND NativeWindow;
typedef HWND NativeEditView;
typedef HDC NativeDrawingContext;
typedef HCURSOR NativeCursor;
@@ -92,8 +110,6 @@
typedef IAccessible* NativeViewAccessible;
#elif defined(OS_MACOSX)
typedef NSFont* NativeFont;
-typedef NSView* NativeView;
-typedef NSWindow* NativeWindow;
typedef NSTextField* NativeEditView;
typedef CGContext* NativeDrawingContext;
typedef void* NativeCursor;
@@ -101,8 +117,6 @@
typedef void* NativeViewAccessible;
#elif defined(USE_WAYLAND)
typedef PangoFontDescription* NativeFont;
-typedef ui::WaylandWindow* NativeView;
-typedef ui::WaylandWindow* NativeWindow;
typedef void* NativeEditView;
typedef cairo_t* NativeDrawingContext;
typedef void* NativeCursor;
@@ -113,8 +127,6 @@
typedef void* NativeViewAccessible;
#elif defined(USE_X11)
typedef PangoFontDescription* NativeFont;
-typedef GtkWidget* NativeView;
-typedef GtkWindow* NativeWindow;
typedef GtkWidget* NativeEditView;
typedef cairo_t* NativeDrawingContext;
typedef GdkCursor* NativeCursor;
@@ -139,7 +151,7 @@
// See comment at the top of the file for usage.
typedef intptr_t NativeViewId;
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
// Convert a NativeViewId to a NativeView.
//
// On Windows, we pass an HWND into the renderer. As stated above, the renderer
@@ -148,10 +160,10 @@
return reinterpret_cast<NativeView>(id);
}
#define NativeViewFromIdInBrowser(x) NativeViewFromId(x)
-#elif defined(OS_POSIX)
-// On Mac and Linux, a NativeView is a pointer to an object, and is useless
-// outside the process in which it was created. NativeViewFromId should only be
-// used inside the appropriate platform ifdef outside of the browser.
+#elif defined(OS_POSIX) || defined(USE_AURA)
+// On Mac, Linux and USE_AURA, a NativeView is a pointer to an object, and is
+// useless outside the process in which it was created. NativeViewFromId should
+// only be used inside the appropriate platform ifdef outside of the browser.
// (NativeViewFromIdInBrowser can be used everywhere in the browser.) If your
// cross-platform design involves a call to NativeViewFromId from outside the
// browser it will never work on Mac or Linux and is fundamentally broken.
« no previous file with comments | « build/common.gypi ('k') | views/controls/menu/menu_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698