| 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/keyboard_listener.h" | 10 #include "content/public/browser/keyboard_listener.h" |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 // Add a keyboard listener that can handle key presses without requiring | 277 // Add a keyboard listener that can handle key presses without requiring |
| 278 // focus. | 278 // focus. |
| 279 virtual void AddKeyboardListener(KeyboardListener* listener) = 0; | 279 virtual void AddKeyboardListener(KeyboardListener* listener) = 0; |
| 280 | 280 |
| 281 // Remove a keyboard listener. | 281 // Remove a keyboard listener. |
| 282 virtual void RemoveKeyboardListener(KeyboardListener* listener) = 0; | 282 virtual void RemoveKeyboardListener(KeyboardListener* listener) = 0; |
| 283 | 283 |
| 284 // Get the screen info corresponding to this render widget. | 284 // Get the screen info corresponding to this render widget. |
| 285 virtual void GetWebScreenInfo(WebKit::WebScreenInfo* result) = 0; | 285 virtual void GetWebScreenInfo(WebKit::WebScreenInfo* result) = 0; |
| 286 | 286 |
| 287 // Grabs snapshot from renderer side and returns the bitmap to a callback. | |
| 288 // If |src_rect| is empty, the whole contents is copied. This is an expensive | |
| 289 // operation due to the IPC, but it can be used as a fallback method when | |
| 290 // CopyFromBackingStore fails due to the backing store not being available or, | |
| 291 // in composited mode, when the accelerated surface is not available to the | |
| 292 // browser side. | |
| 293 virtual void GetSnapshotFromRenderer( | |
| 294 const gfx::Rect& src_subrect, | |
| 295 const base::Callback<void(bool, const SkBitmap&)>& callback) = 0; | |
| 296 | |
| 297 protected: | 287 protected: |
| 298 friend class RenderWidgetHostImpl; | 288 friend class RenderWidgetHostImpl; |
| 299 | 289 |
| 300 // Retrieves the implementation class. Intended only for code | 290 // Retrieves the implementation class. Intended only for code |
| 301 // within content/. This method is necessary because | 291 // within content/. This method is necessary because |
| 302 // RenderWidgetHost is the root of a diamond inheritance pattern, so | 292 // RenderWidgetHost is the root of a diamond inheritance pattern, so |
| 303 // subclasses inherit it virtually, which removes our ability to | 293 // subclasses inherit it virtually, which removes our ability to |
| 304 // static_cast to the subclass. | 294 // static_cast to the subclass. |
| 305 virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() = 0; | 295 virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() = 0; |
| 306 }; | 296 }; |
| 307 | 297 |
| 308 } // namespace content | 298 } // namespace content |
| 309 | 299 |
| 310 #endif // CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ | 300 #endif // CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ |
| OLD | NEW |