| 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&)> |
| 66 CopyFromCompositingSurfaceCallback; |
| 67 |
| 62 // Basic implementation shared by concrete RenderWidgetHostView subclasses. | 68 // Basic implementation shared by concrete RenderWidgetHostView subclasses. |
| 63 class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, | 69 class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, |
| 64 public IPC::Listener { | 70 public IPC::Listener { |
| 65 public: | 71 public: |
| 66 virtual ~RenderWidgetHostViewBase(); | 72 virtual ~RenderWidgetHostViewBase(); |
| 67 | 73 |
| 68 // RenderWidgetHostView implementation. | 74 // RenderWidgetHostView implementation. |
| 69 virtual void SetBackgroundOpaque(bool opaque) OVERRIDE; | 75 virtual void SetBackgroundOpaque(bool opaque) OVERRIDE; |
| 70 virtual bool GetBackgroundOpaque() OVERRIDE; | 76 virtual bool GetBackgroundOpaque() OVERRIDE; |
| 71 virtual ui::TextInputClient* GetTextInputClient() OVERRIDE; | 77 virtual ui::TextInputClient* GetTextInputClient() OVERRIDE; |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 // Copies the contents of the compositing surface, providing a new SkBitmap | 257 // Copies the contents of the compositing surface, providing a new SkBitmap |
| 252 // result via an asynchronously-run |callback|. |src_subrect| is specified in | 258 // 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, | 259 // 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 | 260 // 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 | 261 // 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| | 262 // 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|. | 263 // may be copied if the underlying surface is smaller than |src_subrect|. |
| 258 virtual void CopyFromCompositingSurface( | 264 virtual void CopyFromCompositingSurface( |
| 259 const gfx::Rect& src_subrect, | 265 const gfx::Rect& src_subrect, |
| 260 const gfx::Size& dst_size, | 266 const gfx::Size& dst_size, |
| 261 const base::Callback<void(bool, const SkBitmap&)>& callback, | 267 CopyFromCompositingSurfaceCallback& callback, |
| 262 const SkColorType color_type) = 0; | 268 const SkColorType color_type) = 0; |
| 263 | 269 |
| 264 // Copies the contents of the compositing surface, populating the given | 270 // Copies the contents of the compositing surface, populating the given |
| 265 // |target| with YV12 image data. |src_subrect| is specified in layer space | 271 // |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 | 272 // 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 | 273 // 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, | 274 // scaled and letterboxed with black borders to fit |target|. Finally, |
| 269 // |callback| is asynchronously run with true/false for | 275 // |callback| is asynchronously run with true/false for |
| 270 // success/failure. |target| must point to an allocated, YV12 video frame of | 276 // 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 | 277 // the intended size. This operation will fail if there is no available |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 base::OneShotTimer<RenderWidgetHostViewBase> flush_input_timer_; | 440 base::OneShotTimer<RenderWidgetHostViewBase> flush_input_timer_; |
| 435 | 441 |
| 436 base::WeakPtrFactory<RenderWidgetHostViewBase> weak_factory_; | 442 base::WeakPtrFactory<RenderWidgetHostViewBase> weak_factory_; |
| 437 | 443 |
| 438 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewBase); | 444 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewBase); |
| 439 }; | 445 }; |
| 440 | 446 |
| 441 } // namespace content | 447 } // namespace content |
| 442 | 448 |
| 443 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ | 449 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ |
| OLD | NEW |