| 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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 // source contents is used. |callback| is invoked with true on success, false | 174 // source contents is used. |callback| is invoked with true on success, false |
| 175 // otherwise, along with a SkBitmap containing the copied pixel data. | 175 // otherwise, along with a SkBitmap containing the copied pixel data. |
| 176 // | 176 // |
| 177 // NOTE: |callback| is called synchronously if the backing store is available. | 177 // NOTE: |callback| is called synchronously if the backing store is available. |
| 178 // When accelerated compositing is active, |callback| may be called | 178 // When accelerated compositing is active, |callback| may be called |
| 179 // asynchronously. | 179 // asynchronously. |
| 180 virtual void CopyFromBackingStore( | 180 virtual void CopyFromBackingStore( |
| 181 const gfx::Rect& src_rect, | 181 const gfx::Rect& src_rect, |
| 182 const gfx::Size& accelerated_dst_size, | 182 const gfx::Size& accelerated_dst_size, |
| 183 const base::Callback<void(bool, const SkBitmap&)>& callback, | 183 const base::Callback<void(bool, const SkBitmap&)>& callback, |
| 184 const SkBitmap::Config& bitmap_config) = 0; | 184 const SkColorType color_type) = 0; |
| 185 // Ensures that the view does not drop the backing store even when hidden. | 185 // Ensures that the view does not drop the backing store even when hidden. |
| 186 virtual bool CanCopyFromBackingStore() = 0; | 186 virtual bool CanCopyFromBackingStore() = 0; |
| 187 #if defined(OS_ANDROID) | 187 #if defined(OS_ANDROID) |
| 188 virtual void LockBackingStore() = 0; | 188 virtual void LockBackingStore() = 0; |
| 189 virtual void UnlockBackingStore() = 0; | 189 virtual void UnlockBackingStore() = 0; |
| 190 #endif | 190 #endif |
| 191 | 191 |
| 192 // Send a command to the renderer to turn on full accessibility. | 192 // Send a command to the renderer to turn on full accessibility. |
| 193 virtual void EnableFullAccessibilityMode() = 0; | 193 virtual void EnableFullAccessibilityMode() = 0; |
| 194 | 194 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 const KeyPressEventCallback& callback) = 0; | 283 const KeyPressEventCallback& callback) = 0; |
| 284 | 284 |
| 285 // Add/remove a callback that can handle all kinds of mouse events. | 285 // Add/remove a callback that can handle all kinds of mouse events. |
| 286 typedef base::Callback<bool(const blink::WebMouseEvent&)> MouseEventCallback; | 286 typedef base::Callback<bool(const blink::WebMouseEvent&)> MouseEventCallback; |
| 287 virtual void AddMouseEventCallback(const MouseEventCallback& callback) = 0; | 287 virtual void AddMouseEventCallback(const MouseEventCallback& callback) = 0; |
| 288 virtual void RemoveMouseEventCallback(const MouseEventCallback& callback) = 0; | 288 virtual void RemoveMouseEventCallback(const MouseEventCallback& callback) = 0; |
| 289 | 289 |
| 290 // Get the screen info corresponding to this render widget. | 290 // Get the screen info corresponding to this render widget. |
| 291 virtual void GetWebScreenInfo(blink::WebScreenInfo* result) = 0; | 291 virtual void GetWebScreenInfo(blink::WebScreenInfo* result) = 0; |
| 292 | 292 |
| 293 virtual SkBitmap::Config PreferredReadbackFormat() = 0; | 293 virtual SkColorType PreferredReadbackFormat() = 0; |
| 294 | 294 |
| 295 protected: | 295 protected: |
| 296 friend class RenderWidgetHostImpl; | 296 friend class RenderWidgetHostImpl; |
| 297 | 297 |
| 298 // Retrieves the implementation class. Intended only for code | 298 // Retrieves the implementation class. Intended only for code |
| 299 // within content/. This method is necessary because | 299 // within content/. This method is necessary because |
| 300 // RenderWidgetHost is the root of a diamond inheritance pattern, so | 300 // RenderWidgetHost is the root of a diamond inheritance pattern, so |
| 301 // subclasses inherit it virtually, which removes our ability to | 301 // subclasses inherit it virtually, which removes our ability to |
| 302 // static_cast to the subclass. | 302 // static_cast to the subclass. |
| 303 virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() = 0; | 303 virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() = 0; |
| 304 }; | 304 }; |
| 305 | 305 |
| 306 } // namespace content | 306 } // namespace content |
| 307 | 307 |
| 308 #endif // CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ | 308 #endif // CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ |
| OLD | NEW |