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" |
| 11 #include "content/public/browser/readback_types.h" |
11 #include "ipc/ipc_channel.h" | 12 #include "ipc/ipc_channel.h" |
12 #include "ipc/ipc_sender.h" | 13 #include "ipc/ipc_sender.h" |
13 #include "third_party/WebKit/public/web/WebInputEvent.h" | 14 #include "third_party/WebKit/public/web/WebInputEvent.h" |
14 #include "third_party/WebKit/public/web/WebTextDirection.h" | 15 #include "third_party/WebKit/public/web/WebTextDirection.h" |
15 #include "third_party/skia/include/core/SkBitmap.h" | 16 #include "third_party/skia/include/core/SkBitmap.h" |
16 #include "ui/gfx/size.h" | 17 #include "ui/gfx/size.h" |
17 #include "ui/surface/transport_dib.h" | 18 #include "ui/surface/transport_dib.h" |
18 | 19 |
19 #if defined(OS_MACOSX) | 20 #if defined(OS_MACOSX) |
20 #include "skia/ext/platform_device.h" | 21 #include "skia/ext/platform_device.h" |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 // |accelerated_dst_size| is given and accelerated compositing is active, the | 171 // |accelerated_dst_size| is given and accelerated compositing is active, the |
171 // content is shrunk so that it fits in |accelerated_dst_size|. If | 172 // content is shrunk so that it fits in |accelerated_dst_size|. If |
172 // |accelerated_dst_size| is larger than the content size, the content is not | 173 // |accelerated_dst_size| is larger than the content size, the content is not |
173 // resized. If |accelerated_dst_size| is empty, the size copied from the | 174 // resized. If |accelerated_dst_size| is empty, the size copied from the |
174 // source contents is used. |callback| is invoked with true on success, false | 175 // source contents is used. |callback| is invoked with true on success, false |
175 // otherwise, along with a SkBitmap containing the copied pixel data. | 176 // otherwise, along with a SkBitmap containing the copied pixel data. |
176 // | 177 // |
177 // NOTE: |callback| is called synchronously if the backing store is available. | 178 // NOTE: |callback| is called synchronously if the backing store is available. |
178 // When accelerated compositing is active, |callback| may be called | 179 // When accelerated compositing is active, |callback| may be called |
179 // asynchronously. | 180 // asynchronously. |
180 virtual void CopyFromBackingStore( | 181 virtual void CopyFromBackingStore(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 ReadbackRequestCallback& callback, |
183 const base::Callback<void(bool, const SkBitmap&)>& callback, | 184 const SkColorType color_type) = 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 // Forwards the given message to the renderer. These are called by | 192 // Forwards the given message to the renderer. These are called by |
193 // the view when it has received a message. | 193 // the view when it has received a message. |
194 virtual void ForwardMouseEvent( | 194 virtual void ForwardMouseEvent( |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 // within content/. This method is necessary because | 258 // within content/. This method is necessary because |
259 // RenderWidgetHost is the root of a diamond inheritance pattern, so | 259 // RenderWidgetHost is the root of a diamond inheritance pattern, so |
260 // subclasses inherit it virtually, which removes our ability to | 260 // subclasses inherit it virtually, which removes our ability to |
261 // static_cast to the subclass. | 261 // static_cast to the subclass. |
262 virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() = 0; | 262 virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() = 0; |
263 }; | 263 }; |
264 | 264 |
265 } // namespace content | 265 } // namespace content |
266 | 266 |
267 #endif // CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ | 267 #endif // CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ |
OLD | NEW |