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 CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ |
7 | 7 |
8 #if defined(OS_MACOSX) | 8 #if defined(OS_MACOSX) |
9 #include <OpenGL/OpenGL.h> | 9 #include <OpenGL/OpenGL.h> |
10 #endif | 10 #endif |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
52 namespace content { | 52 namespace content { |
53 class BrowserAccessibilityDelegate; | 53 class BrowserAccessibilityDelegate; |
54 class BrowserAccessibilityManager; | 54 class BrowserAccessibilityManager; |
55 class SyntheticGesture; | 55 class SyntheticGesture; |
56 class SyntheticGestureTarget; | 56 class SyntheticGestureTarget; |
57 class WebCursor; | 57 class WebCursor; |
58 struct DidOverscrollParams; | 58 struct DidOverscrollParams; |
59 struct NativeWebKeyboardEvent; | 59 struct NativeWebKeyboardEvent; |
60 struct WebPluginGeometry; | 60 struct WebPluginGeometry; |
61 | 61 |
62 // TODO(Sikugu): Though we have the return status of the result here, | |
63 // we should add the reason for failure as a new parameter to handle cases | |
64 // efficiently. | |
65 typedef const base::Callback<void(bool, const SkBitmap&)> CompletionCallback; | |
piman
2014/09/16 20:24:56
Can we either expand the name, or scope it?
conte
sivag
2014/09/17 11:17:11
Done.
| |
66 | |
62 // Basic implementation shared by concrete RenderWidgetHostView subclasses. | 67 // Basic implementation shared by concrete RenderWidgetHostView subclasses. |
63 class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, | 68 class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, |
64 public IPC::Listener { | 69 public IPC::Listener { |
65 public: | 70 public: |
66 virtual ~RenderWidgetHostViewBase(); | 71 virtual ~RenderWidgetHostViewBase(); |
67 | 72 |
68 // RenderWidgetHostView implementation. | 73 // RenderWidgetHostView implementation. |
69 virtual void SetBackgroundOpaque(bool opaque) OVERRIDE; | 74 virtual void SetBackgroundOpaque(bool opaque) OVERRIDE; |
70 virtual bool GetBackgroundOpaque() OVERRIDE; | 75 virtual bool GetBackgroundOpaque() OVERRIDE; |
71 virtual ui::TextInputClient* GetTextInputClient() OVERRIDE; | 76 virtual ui::TextInputClient* GetTextInputClient() OVERRIDE; |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
248 virtual void SelectionBoundsChanged( | 253 virtual void SelectionBoundsChanged( |
249 const ViewHostMsg_SelectionBounds_Params& params) = 0; | 254 const ViewHostMsg_SelectionBounds_Params& params) = 0; |
250 | 255 |
251 // Copies the contents of the compositing surface, providing a new SkBitmap | 256 // Copies the contents of the compositing surface, providing a new SkBitmap |
252 // result via an asynchronously-run |callback|. |src_subrect| is specified in | 257 // result via an asynchronously-run |callback|. |src_subrect| is specified in |
253 // layer space coordinates for the current platform (e.g., DIP for Aura/Mac, | 258 // layer space coordinates for the current platform (e.g., DIP for Aura/Mac, |
254 // physical for Android), and is the region to be copied from this view. The | 259 // physical for Android), and is the region to be copied from this view. The |
255 // copy is then scaled to a SkBitmap of size |dst_size|. |callback| is run | 260 // copy is then scaled to a SkBitmap of size |dst_size|. |callback| is run |
256 // with true on success, false otherwise. A smaller region than |src_subrect| | 261 // with true on success, false otherwise. A smaller region than |src_subrect| |
257 // may be copied if the underlying surface is smaller than |src_subrect|. | 262 // may be copied if the underlying surface is smaller than |src_subrect|. |
258 virtual void CopyFromCompositingSurface( | 263 virtual void CopyFromCompositingSurface(const gfx::Rect& src_subrect, |
259 const gfx::Rect& src_subrect, | 264 const gfx::Size& dst_size, |
260 const gfx::Size& dst_size, | 265 CompletionCallback& callback, |
261 const base::Callback<void(bool, const SkBitmap&)>& callback, | 266 const SkColorType color_type) = 0; |
262 const SkColorType color_type) = 0; | |
263 | 267 |
264 // Copies the contents of the compositing surface, populating the given | 268 // Copies the contents of the compositing surface, populating the given |
265 // |target| with YV12 image data. |src_subrect| is specified in layer space | 269 // |target| with YV12 image data. |src_subrect| is specified in layer space |
266 // coordinates for the current platform (e.g., DIP for Aura/Mac, physical for | 270 // coordinates for the current platform (e.g., DIP for Aura/Mac, physical for |
267 // Android), and is the region to be copied from this view. The copy is then | 271 // Android), and is the region to be copied from this view. The copy is then |
268 // scaled and letterboxed with black borders to fit |target|. Finally, | 272 // scaled and letterboxed with black borders to fit |target|. Finally, |
269 // |callback| is asynchronously run with true/false for | 273 // |callback| is asynchronously run with true/false for |
270 // success/failure. |target| must point to an allocated, YV12 video frame of | 274 // success/failure. |target| must point to an allocated, YV12 video frame of |
271 // the intended size. This operation will fail if there is no available | 275 // the intended size. This operation will fail if there is no available |
272 // compositing surface. | 276 // compositing surface. |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
434 base::OneShotTimer<RenderWidgetHostViewBase> flush_input_timer_; | 438 base::OneShotTimer<RenderWidgetHostViewBase> flush_input_timer_; |
435 | 439 |
436 base::WeakPtrFactory<RenderWidgetHostViewBase> weak_factory_; | 440 base::WeakPtrFactory<RenderWidgetHostViewBase> weak_factory_; |
437 | 441 |
438 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewBase); | 442 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewBase); |
439 }; | 443 }; |
440 | 444 |
441 } // namespace content | 445 } // namespace content |
442 | 446 |
443 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ | 447 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ |
OLD | NEW |