OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #if defined(OS_MACOSX) | 9 #if defined(OS_MACOSX) |
10 #include <OpenGL/OpenGL.h> | 10 #include <OpenGL/OpenGL.h> |
11 #endif | 11 #endif |
12 | 12 |
13 #include <string> | 13 #include <string> |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
16 #include "base/process_util.h" | 16 #include "base/process_util.h" |
17 #include "base/callback.h" | 17 #include "base/callback.h" |
18 #include "content/common/content_export.h" | 18 #include "content/common/content_export.h" |
19 #include "third_party/skia/include/core/SkBitmap.h" | 19 #include "third_party/skia/include/core/SkBitmap.h" |
20 #include "third_party/skia/include/core/SkColor.h" | 20 #include "third_party/skia/include/core/SkColor.h" |
21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h" | 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h" |
23 #include "ui/base/ime/text_input_type.h" | 23 #include "ui/base/ime/text_input_type.h" |
24 #include "ui/base/range/range.h" | 24 #include "ui/base/range/range.h" |
25 #include "ui/gfx/native_widget_types.h" | 25 #include "ui/gfx/native_widget_types.h" |
26 #include "ui/gfx/rect.h" | 26 #include "ui/gfx/rect.h" |
27 #include "ui/gfx/surface/transport_dib.h" | 27 #include "ui/gfx/surface/transport_dib.h" |
28 | 28 |
| 29 struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; |
| 30 |
29 class BackingStore; | 31 class BackingStore; |
30 class RenderWidgetHost; | 32 class RenderWidgetHost; |
31 class WebCursor; | 33 class WebCursor; |
32 struct NativeWebKeyboardEvent; | 34 struct NativeWebKeyboardEvent; |
33 struct ViewHostMsg_AccessibilityNotification_Params; | 35 struct ViewHostMsg_AccessibilityNotification_Params; |
34 | 36 |
35 namespace content { | 37 namespace content { |
36 class RenderProcessHost; | 38 class RenderProcessHost; |
37 } | 39 } |
38 | 40 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 | 182 |
181 // Tells the View whether the context menu is showing. This is used on Linux | 183 // Tells the View whether the context menu is showing. This is used on Linux |
182 // to suppress updates to webkit focus for the duration of the show. | 184 // to suppress updates to webkit focus for the duration of the show. |
183 virtual void ShowingContextMenu(bool showing) {} | 185 virtual void ShowingContextMenu(bool showing) {} |
184 | 186 |
185 // Allocate a backing store for this view | 187 // Allocate a backing store for this view |
186 virtual BackingStore* AllocBackingStore(const gfx::Size& size) = 0; | 188 virtual BackingStore* AllocBackingStore(const gfx::Size& size) = 0; |
187 | 189 |
188 // Called when accelerated compositing state changes. | 190 // Called when accelerated compositing state changes. |
189 virtual void OnAcceleratedCompositingStateChange() = 0; | 191 virtual void OnAcceleratedCompositingStateChange() = 0; |
| 192 // |params.window| and |params.surface_id| indicate which accelerated |
| 193 // surface's buffers swapped. |params.renderer_id| and |params.route_id| |
| 194 // are used to formulate a reply to the GPU process to prevent it from getting |
| 195 // too far ahead. They may all be zero, in which case no flow control is |
| 196 // enforced; this case is currently used for accelerated plugins. |
| 197 virtual void AcceleratedSurfaceBuffersSwapped( |
| 198 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params, |
| 199 int gpu_host_id) = 0; |
190 | 200 |
191 #if defined(OS_MACOSX) | 201 #if defined(OS_MACOSX) |
192 // Tells the view whether or not to accept first responder status. If |flag| | 202 // Tells the view whether or not to accept first responder status. If |flag| |
193 // is true, the view does not accept first responder status and instead | 203 // is true, the view does not accept first responder status and instead |
194 // manually becomes first responder when it receives a mouse down event. If | 204 // manually becomes first responder when it receives a mouse down event. If |
195 // |flag| is false, the view participates in the key-view chain as normal. | 205 // |flag| is false, the view participates in the key-view chain as normal. |
196 virtual void SetTakesFocusOnlyOnMouseDown(bool flag) = 0; | 206 virtual void SetTakesFocusOnlyOnMouseDown(bool flag) = 0; |
197 | 207 |
198 // Retrieve the bounds of the view, in cocoa view coordinates. | 208 // Retrieve the bounds of the view, in cocoa view coordinates. |
199 // If the UI scale factor is 2, |GetViewBounds()| will return a size of e.g. | 209 // If the UI scale factor is 2, |GetViewBounds()| will return a size of e.g. |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 virtual void AcceleratedSurfaceSetIOSurface( | 246 virtual void AcceleratedSurfaceSetIOSurface( |
237 gfx::PluginWindowHandle window, | 247 gfx::PluginWindowHandle window, |
238 int32 width, | 248 int32 width, |
239 int32 height, | 249 int32 height, |
240 uint64 io_surface_identifier) = 0; | 250 uint64 io_surface_identifier) = 0; |
241 virtual void AcceleratedSurfaceSetTransportDIB( | 251 virtual void AcceleratedSurfaceSetTransportDIB( |
242 gfx::PluginWindowHandle window, | 252 gfx::PluginWindowHandle window, |
243 int32 width, | 253 int32 width, |
244 int32 height, | 254 int32 height, |
245 TransportDIB::Handle transport_dib) = 0; | 255 TransportDIB::Handle transport_dib) = 0; |
246 // |window| and |surface_id| indicate which accelerated surface's | |
247 // buffers swapped. |renderer_id| and |route_id| are used to formulate | |
248 // a reply to the GPU process to prevent it from getting too far ahead. | |
249 // They may all be zero, in which case no flow control is enforced; | |
250 // this case is currently used for accelerated plugins. | |
251 virtual void AcceleratedSurfaceBuffersSwapped( | |
252 gfx::PluginWindowHandle window, | |
253 uint64 surface_id, | |
254 int renderer_id, | |
255 int32 route_id, | |
256 int gpu_host_id) = 0; | |
257 #endif | 256 #endif |
258 | 257 |
259 #if defined(UI_COMPOSITOR_IMAGE_TRANSPORT) | 258 #if defined(UI_COMPOSITOR_IMAGE_TRANSPORT) |
260 virtual void AcceleratedSurfaceNew( | 259 virtual void AcceleratedSurfaceNew( |
261 int32 width, | 260 int32 width, |
262 int32 height, | 261 int32 height, |
263 uint64* surface_id, | 262 uint64* surface_id, |
264 TransportDIB::Handle* surface_handle) = 0; | 263 TransportDIB::Handle* surface_handle) = 0; |
265 virtual void AcceleratedSurfaceBuffersSwapped( | |
266 uint64 surface_id, | |
267 int32 route_id, | |
268 int gpu_host_id) = 0; | |
269 virtual void AcceleratedSurfaceRelease(uint64 surface_id) = 0; | 264 virtual void AcceleratedSurfaceRelease(uint64 surface_id) = 0; |
270 #endif | 265 #endif |
271 | 266 |
272 #if defined(TOOLKIT_USES_GTK) | 267 #if defined(TOOLKIT_USES_GTK) |
273 virtual void CreatePluginContainer(gfx::PluginWindowHandle id) = 0; | 268 virtual void CreatePluginContainer(gfx::PluginWindowHandle id) = 0; |
274 virtual void DestroyPluginContainer(gfx::PluginWindowHandle id) = 0; | 269 virtual void DestroyPluginContainer(gfx::PluginWindowHandle id) = 0; |
275 #endif | 270 #endif |
276 | 271 |
277 #if defined(OS_WIN) && !defined(USE_AURA) | 272 #if defined(OS_WIN) && !defined(USE_AURA) |
278 virtual void WillWmDestroy() = 0; | 273 virtual void WillWmDestroy() = 0; |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 size_t selection_text_offset_; | 354 size_t selection_text_offset_; |
360 | 355 |
361 // The current selection range relative to the start of the web page. | 356 // The current selection range relative to the start of the web page. |
362 ui::Range selection_range_; | 357 ui::Range selection_range_; |
363 | 358 |
364 private: | 359 private: |
365 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostView); | 360 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostView); |
366 }; | 361 }; |
367 | 362 |
368 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_H_ | 363 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_H_ |
OLD | NEW |