Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(414)

Side by Side Diff: content/public/browser/render_widget_host.h

Issue 2702093002: Consistent CopyFromSurface() API, consolidated to RWHV (Closed)
Patch Set: Per alexmos, simplification in NavigationEntryScreenshotManager. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "content/common/content_export.h" 11 #include "content/common/content_export.h"
12 #include "content/public/browser/native_web_keyboard_event.h" 12 #include "content/public/browser/native_web_keyboard_event.h"
13 #include "content/public/browser/readback_types.h"
14 #include "content/public/common/drop_data.h" 13 #include "content/public/common/drop_data.h"
15 #include "ipc/ipc_channel.h" 14 #include "ipc/ipc_channel.h"
16 #include "ipc/ipc_sender.h" 15 #include "ipc/ipc_sender.h"
17 #include "third_party/WebKit/public/platform/WebDragOperation.h" 16 #include "third_party/WebKit/public/platform/WebDragOperation.h"
18 #include "third_party/WebKit/public/platform/WebGestureEvent.h" 17 #include "third_party/WebKit/public/platform/WebGestureEvent.h"
19 #include "third_party/WebKit/public/platform/WebInputEvent.h" 18 #include "third_party/WebKit/public/platform/WebInputEvent.h"
20 #include "third_party/WebKit/public/web/WebTextDirection.h" 19 #include "third_party/WebKit/public/web/WebTextDirection.h"
21 #include "third_party/skia/include/core/SkImageInfo.h"
22 #include "ui/gfx/geometry/size.h" 20 #include "ui/gfx/geometry/size.h"
23 #include "ui/surface/transport_dib.h" 21 #include "ui/surface/transport_dib.h"
24 22
25 namespace gfx {
26 class Rect;
27 }
28
29 namespace blink { 23 namespace blink {
30 class WebMouseEvent; 24 class WebMouseEvent;
31 class WebMouseWheelEvent; 25 class WebMouseWheelEvent;
32 } 26 }
33 27
34 namespace content { 28 namespace content {
35 29
36 class RenderProcessHost; 30 class RenderProcessHost;
37 class RenderWidgetHostIterator; 31 class RenderWidgetHostIterator;
38 class RenderWidgetHostView; 32 class RenderWidgetHostView;
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 virtual void NotifyTextDirection() = 0; 149 virtual void NotifyTextDirection() = 0;
156 150
157 virtual void Focus() = 0; 151 virtual void Focus() = 0;
158 virtual void Blur() = 0; 152 virtual void Blur() = 0;
159 153
160 // Sets whether the renderer should show controls in an active state. On all 154 // Sets whether the renderer should show controls in an active state. On all
161 // platforms except mac, that's the same as focused. On mac, the frontmost 155 // platforms except mac, that's the same as focused. On mac, the frontmost
162 // window will show active controls even if the focus is not in the web 156 // window will show active controls even if the focus is not in the web
163 // contents, but e.g. in the omnibox. 157 // contents, but e.g. in the omnibox.
164 virtual void SetActive(bool active) = 0; 158 virtual void SetActive(bool active) = 0;
165 159
ncarter (slow) 2017/03/01 18:34:26 Really glad to see this vestigial nomenclature go:
miu 2017/03/01 22:18:24 Done. PTAL at render_widget_helper.h to make sure
166 // Copies the given subset of the backing store, and passes the result as a
167 // bitmap to a callback.
168 //
169 // If |src_rect| is empty, the whole contents is copied. If non empty
170 // |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 // |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 // source contents is used. |callback| is invoked with true on success, false
175 // otherwise, along with a SkBitmap containing the copied pixel data.
176 //
177 // NOTE: |callback| is called synchronously if the backing store is available.
178 // When accelerated compositing is active, |callback| may be called
179 // asynchronously.
180 virtual void CopyFromBackingStore(const gfx::Rect& src_rect,
181 const gfx::Size& accelerated_dst_size,
182 const ReadbackRequestCallback& callback,
183 const SkColorType color_type) = 0;
184 // Ensures that the view does not drop the backing store even when hidden.
185 virtual bool CanCopyFromBackingStore() = 0;
186
187 // Forwards the given message to the renderer. These are called by 160 // Forwards the given message to the renderer. These are called by
188 // the view when it has received a message. 161 // the view when it has received a message.
189 virtual void ForwardMouseEvent( 162 virtual void ForwardMouseEvent(
190 const blink::WebMouseEvent& mouse_event) = 0; 163 const blink::WebMouseEvent& mouse_event) = 0;
191 virtual void ForwardWheelEvent( 164 virtual void ForwardWheelEvent(
192 const blink::WebMouseWheelEvent& wheel_event) = 0; 165 const blink::WebMouseWheelEvent& wheel_event) = 0;
193 virtual void ForwardKeyboardEvent( 166 virtual void ForwardKeyboardEvent(
194 const NativeWebKeyboardEvent& key_event) = 0; 167 const NativeWebKeyboardEvent& key_event) = 0;
195 virtual void ForwardGestureEvent( 168 virtual void ForwardGestureEvent(
196 const blink::WebGestureEvent& gesture_event) = 0; 169 const blink::WebGestureEvent& gesture_event) = 0;
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 // This allows the renderer to reset some state. 266 // This allows the renderer to reset some state.
294 virtual void DragSourceSystemDragEnded() {}; 267 virtual void DragSourceSystemDragEnded() {};
295 268
296 // Filters drop data before it is passed to RenderWidgetHost. 269 // Filters drop data before it is passed to RenderWidgetHost.
297 virtual void FilterDropData(DropData* drop_data) {} 270 virtual void FilterDropData(DropData* drop_data) {}
298 }; 271 };
299 272
300 } // namespace content 273 } // namespace content
301 274
302 #endif // CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ 275 #endif // CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698