| 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_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ | 6 #define CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
| 10 #include "content/public/browser/native_web_keyboard_event.h" | 10 #include "content/public/browser/native_web_keyboard_event.h" |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 // source contents is used. |callback| is invoked with true on success, false | 193 // source contents is used. |callback| is invoked with true on success, false |
| 194 // otherwise, along with a SkBitmap containing the copied pixel data. | 194 // otherwise, along with a SkBitmap containing the copied pixel data. |
| 195 // | 195 // |
| 196 // NOTE: |callback| is called synchronously if the backing store is available. | 196 // NOTE: |callback| is called synchronously if the backing store is available. |
| 197 // When accelerated compositing is active, |callback| may be called | 197 // When accelerated compositing is active, |callback| may be called |
| 198 // asynchronously. | 198 // asynchronously. |
| 199 virtual void CopyFromBackingStore( | 199 virtual void CopyFromBackingStore( |
| 200 const gfx::Rect& src_rect, | 200 const gfx::Rect& src_rect, |
| 201 const gfx::Size& accelerated_dst_size, | 201 const gfx::Size& accelerated_dst_size, |
| 202 const base::Callback<void(bool, const SkBitmap&)>& callback) = 0; | 202 const base::Callback<void(bool, const SkBitmap&)>& callback) = 0; |
| 203 // Ensures that the view does not drop the backing store even when hidden. |
| 204 virtual bool CanCopyFromBackingStore() = 0; |
| 205 #if defined(OS_ANDROID) |
| 206 virtual void LockForCopyFromBackingStore() = 0; |
| 207 virtual void UnlockForCopyFromBackingStore() = 0; |
| 208 #endif |
| 203 #if defined(TOOLKIT_GTK) | 209 #if defined(TOOLKIT_GTK) |
| 204 // Paint the backing store into the target's |dest_rect|. | 210 // Paint the backing store into the target's |dest_rect|. |
| 205 virtual bool CopyFromBackingStoreToGtkWindow(const gfx::Rect& dest_rect, | 211 virtual bool CopyFromBackingStoreToGtkWindow(const gfx::Rect& dest_rect, |
| 206 GdkWindow* target) = 0; | 212 GdkWindow* target) = 0; |
| 207 #elif defined(OS_MACOSX) | 213 #elif defined(OS_MACOSX) |
| 208 virtual gfx::Size GetBackingStoreSize() = 0; | 214 virtual gfx::Size GetBackingStoreSize() = 0; |
| 209 virtual bool CopyFromBackingStoreToCGContext(const CGRect& dest_rect, | 215 virtual bool CopyFromBackingStoreToCGContext(const CGRect& dest_rect, |
| 210 CGContextRef target) = 0; | 216 CGContextRef target) = 0; |
| 211 #endif | 217 #endif |
| 212 | 218 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 // within content/. This method is necessary because | 309 // within content/. This method is necessary because |
| 304 // RenderWidgetHost is the root of a diamond inheritance pattern, so | 310 // RenderWidgetHost is the root of a diamond inheritance pattern, so |
| 305 // subclasses inherit it virtually, which removes our ability to | 311 // subclasses inherit it virtually, which removes our ability to |
| 306 // static_cast to the subclass. | 312 // static_cast to the subclass. |
| 307 virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() = 0; | 313 virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() = 0; |
| 308 }; | 314 }; |
| 309 | 315 |
| 310 } // namespace content | 316 } // namespace content |
| 311 | 317 |
| 312 #endif // CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ | 318 #endif // CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ |
| OLD | NEW |