OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_GFX_NATIVE_WIDGET_TYPES_H_ | 5 #ifndef UI_GFX_NATIVE_WIDGET_TYPES_H_ |
6 #define UI_GFX_NATIVE_WIDGET_TYPES_H_ | 6 #define UI_GFX_NATIVE_WIDGET_TYPES_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 #if defined(OS_ANDROID) | 10 #if defined(OS_ANDROID) |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 // browser it will never work on Mac or Linux and is fundamentally broken. | 226 // browser it will never work on Mac or Linux and is fundamentally broken. |
227 | 227 |
228 // Please do not call this from outside the browser. It won't work; the name | 228 // Please do not call this from outside the browser. It won't work; the name |
229 // should give you a subtle hint. | 229 // should give you a subtle hint. |
230 static inline NativeView NativeViewFromIdInBrowser(NativeViewId id) { | 230 static inline NativeView NativeViewFromIdInBrowser(NativeViewId id) { |
231 return reinterpret_cast<NativeView>(id); | 231 return reinterpret_cast<NativeView>(id); |
232 } | 232 } |
233 #endif // defined(OS_POSIX) | 233 #endif // defined(OS_POSIX) |
234 | 234 |
235 // PluginWindowHandle is an abstraction wrapping "the types of windows | 235 // PluginWindowHandle is an abstraction wrapping "the types of windows |
236 // used by NPAPI plugins". On Windows it's an HWND, on X it's an X | 236 // used by NPAPI plugins". On Windows it's an HWND, on X it's an X |
237 // window id. | 237 // window id. |
238 #if defined(OS_WIN) | 238 #if defined(OS_WIN) |
239 typedef HWND PluginWindowHandle; | 239 typedef HWND PluginWindowHandle; |
240 const PluginWindowHandle kNullPluginWindow = NULL; | 240 const PluginWindowHandle kNullPluginWindow = NULL; |
241 #elif defined(USE_X11) | 241 #elif defined(USE_X11) |
242 typedef unsigned long PluginWindowHandle; | 242 typedef unsigned long PluginWindowHandle; |
243 const PluginWindowHandle kNullPluginWindow = 0; | 243 const PluginWindowHandle kNullPluginWindow = 0; |
244 #elif defined(USE_AURA) && defined(OS_MACOSX) | |
245 // Mac-Aura uses NSView-backed GLSurface. Regular Mac does not. | |
246 // TODO(dhollowa): Rationalize these two definitions. http://crbug.com/104551. | |
247 typedef NSView* PluginWindowHandle; | |
248 const PluginWindowHandle kNullPluginWindow = 0; | |
249 #elif defined(OS_ANDROID) | 244 #elif defined(OS_ANDROID) |
250 typedef uint64 PluginWindowHandle; | 245 typedef uint64 PluginWindowHandle; |
251 const PluginWindowHandle kNullPluginWindow = 0; | 246 const PluginWindowHandle kNullPluginWindow = 0; |
252 #elif defined(USE_OZONE) | 247 #elif defined(USE_OZONE) |
253 typedef intptr_t PluginWindowHandle; | 248 typedef intptr_t PluginWindowHandle; |
254 const PluginWindowHandle kNullPluginWindow = 0; | 249 const PluginWindowHandle kNullPluginWindow = 0; |
255 #else | 250 #else |
256 // On OS X we don't have windowed plugins. | 251 // On Mac we don't have windowed plugins. We use a NULL/0 PluginWindowHandle |
257 // We use a NULL/0 PluginWindowHandle in shared code to indicate there | 252 // in shared code to indicate there is no window present. |
258 // is no window present, so mirror that behavior here. | 253 typedef bool PluginWindowHandle; |
259 // | |
260 // The GPU plugin is currently an exception to this rule. As of this | |
261 // writing it uses some NPAPI infrastructure, and minimally we need | |
262 // to identify the plugin instance via this window handle. When the | |
263 // GPU plugin becomes a full-on GPU process, this typedef can be | |
264 // returned to a bool. For now we use a type large enough to hold a | |
265 // pointer on 64-bit architectures in case we need this capability. | |
266 typedef uint64 PluginWindowHandle; | |
267 const PluginWindowHandle kNullPluginWindow = 0; | 254 const PluginWindowHandle kNullPluginWindow = 0; |
268 #endif | 255 #endif |
269 | 256 |
270 enum SurfaceType { | 257 enum SurfaceType { |
271 EMPTY, | 258 EMPTY, |
272 NATIVE_DIRECT, | 259 NATIVE_DIRECT, |
273 NATIVE_TRANSPORT, | 260 NATIVE_TRANSPORT, |
274 TEXTURE_TRANSPORT | 261 TEXTURE_TRANSPORT |
275 }; | 262 }; |
276 | 263 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 #elif defined(USE_OZONE) | 304 #elif defined(USE_OZONE) |
318 typedef intptr_t AcceleratedWidget; | 305 typedef intptr_t AcceleratedWidget; |
319 const AcceleratedWidget kNullAcceleratedWidget = 0; | 306 const AcceleratedWidget kNullAcceleratedWidget = 0; |
320 #else | 307 #else |
321 #error unknown platform | 308 #error unknown platform |
322 #endif | 309 #endif |
323 | 310 |
324 } // namespace gfx | 311 } // namespace gfx |
325 | 312 |
326 #endif // UI_GFX_NATIVE_WIDGET_TYPES_H_ | 313 #endif // UI_GFX_NATIVE_WIDGET_TYPES_H_ |
OLD | NEW |