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

Side by Side Diff: content/browser/renderer_host/render_widget_host_impl.h

Issue 2732923002: Add fromSurface optional parameter to devtools Page.CaptureScreenshot (Closed)
Patch Set: nit change method name 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_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 #include "content/public/common/page_zoom.h" 42 #include "content/public/common/page_zoom.h"
43 #include "content/public/common/url_constants.h" 43 #include "content/public/common/url_constants.h"
44 #include "ipc/ipc_listener.h" 44 #include "ipc/ipc_listener.h"
45 #include "third_party/WebKit/public/platform/WebDisplayMode.h" 45 #include "third_party/WebKit/public/platform/WebDisplayMode.h"
46 #include "ui/base/ime/text_input_mode.h" 46 #include "ui/base/ime/text_input_mode.h"
47 #include "ui/base/ime/text_input_type.h" 47 #include "ui/base/ime/text_input_type.h"
48 #include "ui/events/gesture_detection/gesture_provider_config_helper.h" 48 #include "ui/events/gesture_detection/gesture_provider_config_helper.h"
49 #include "ui/events/latency_info.h" 49 #include "ui/events/latency_info.h"
50 #include "ui/gfx/native_widget_types.h" 50 #include "ui/gfx/native_widget_types.h"
51 51
52 class SkBitmap;
52 struct FrameHostMsg_HittestData_Params; 53 struct FrameHostMsg_HittestData_Params;
53 struct ViewHostMsg_SelectionBounds_Params; 54 struct ViewHostMsg_SelectionBounds_Params;
54 struct ViewHostMsg_UpdateRect_Params; 55 struct ViewHostMsg_UpdateRect_Params;
55 56
56 namespace blink { 57 namespace blink {
57 class WebInputEvent; 58 class WebInputEvent;
58 class WebMouseEvent; 59 class WebMouseEvent;
59 struct WebCompositionUnderline; 60 struct WebCompositionUnderline;
60 } 61 }
61 62
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 203
203 // Forces redraw in the renderer and when the update reaches the browser 204 // Forces redraw in the renderer and when the update reaches the browser
204 // grabs snapshot from the compositor. On MacOS, the snapshot is taken from 205 // grabs snapshot from the compositor. On MacOS, the snapshot is taken from
205 // the Cocoa view for end-to-end testing purposes. Returns a gfx::Image that 206 // the Cocoa view for end-to-end testing purposes. Returns a gfx::Image that
206 // is backed by an NSImage on MacOS or by an SkBitmap otherwise. The 207 // is backed by an NSImage on MacOS or by an SkBitmap otherwise. The
207 // gfx::Image may be empty if the snapshot failed. 208 // gfx::Image may be empty if the snapshot failed.
208 using GetSnapshotFromBrowserCallback = 209 using GetSnapshotFromBrowserCallback =
209 base::Callback<void(const gfx::Image&)>; 210 base::Callback<void(const gfx::Image&)>;
210 void GetSnapshotFromBrowser(const GetSnapshotFromBrowserCallback& callback); 211 void GetSnapshotFromBrowser(const GetSnapshotFromBrowserCallback& callback);
211 212
213 using GetBitmapSnapshotFromBrowserCallback =
214 base::Callback<void(const SkBitmap&)>;
215 void GetBitmapSnapshotFromBrowser(
216 const GetBitmapSnapshotFromBrowserCallback& callback);
217
212 const NativeWebKeyboardEvent* GetLastKeyboardEvent() const; 218 const NativeWebKeyboardEvent* GetLastKeyboardEvent() const;
213 219
214 // Sets the View of this RenderWidgetHost. 220 // Sets the View of this RenderWidgetHost.
215 void SetView(RenderWidgetHostViewBase* view); 221 void SetView(RenderWidgetHostViewBase* view);
216 222
217 RenderWidgetHostDelegate* delegate() const { return delegate_; } 223 RenderWidgetHostDelegate* delegate() const { return delegate_; }
218 224
219 bool empty() const { return current_size_.IsEmpty(); } 225 bool empty() const { return current_size_.IsEmpty(); }
220 226
221 // Called when a renderer object already been created for this host, and we 227 // Called when a renderer object already been created for this host, and we
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
686 void OnUnexpectedEventAck(UnexpectedEventAckType type) override; 692 void OnUnexpectedEventAck(UnexpectedEventAckType type) override;
687 693
688 void OnSyntheticGestureCompleted(SyntheticGesture::Result result); 694 void OnSyntheticGestureCompleted(SyntheticGesture::Result result);
689 695
690 // Called when there is a new auto resize (using a post to avoid a stack 696 // Called when there is a new auto resize (using a post to avoid a stack
691 // which may get in recursive loops). 697 // which may get in recursive loops).
692 void DelayedAutoResized(); 698 void DelayedAutoResized();
693 699
694 void WindowSnapshotReachedScreen(int snapshot_id); 700 void WindowSnapshotReachedScreen(int snapshot_id);
695 701
702 void OnBitmapSnapshotReceived(int snapshot_id,
703 int retry_count,
704 const SkBitmap& bitmap,
705 ReadbackResponse response);
706
696 void OnSnapshotReceived(int snapshot_id, const gfx::Image& image); 707 void OnSnapshotReceived(int snapshot_id, const gfx::Image& image);
697 708
698 // 1. Grants permissions to URL (if any) 709 // 1. Grants permissions to URL (if any)
699 // 2. Grants permissions to filenames 710 // 2. Grants permissions to filenames
700 // 3. Grants permissions to file system files. 711 // 3. Grants permissions to file system files.
701 // 4. Register the files with the IsolatedContext. 712 // 4. Register the files with the IsolatedContext.
702 void GrantFileAccessFromDropData(DropData* drop_data); 713 void GrantFileAccessFromDropData(DropData* drop_data);
703 714
704 // true if a renderer has once been valid. We use this flag to display a sad 715 // true if a renderer has once been valid. We use this flag to display a sad
705 // tab only when we lose our renderer and not if a paint occurs during 716 // tab only when we lose our renderer and not if a paint occurs during
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 // receipt of those messages (unless FirstPaintAfterLoad is prevented from 861 // receipt of those messages (unless FirstPaintAfterLoad is prevented from
851 // being sent, in which case the timer should fire). 862 // being sent, in which case the timer should fire).
852 bool received_paint_after_load_; 863 bool received_paint_after_load_;
853 864
854 RenderWidgetHostLatencyTracker latency_tracker_; 865 RenderWidgetHostLatencyTracker latency_tracker_;
855 866
856 int next_browser_snapshot_id_; 867 int next_browser_snapshot_id_;
857 using PendingSnapshotMap = std::map<int, GetSnapshotFromBrowserCallback>; 868 using PendingSnapshotMap = std::map<int, GetSnapshotFromBrowserCallback>;
858 PendingSnapshotMap pending_browser_snapshots_; 869 PendingSnapshotMap pending_browser_snapshots_;
859 870
871 using PendingBitmapSnapshotMap =
872 std::map<int, GetBitmapSnapshotFromBrowserCallback>;
873 PendingBitmapSnapshotMap pending_bitmap_browser_snapshots_;
874
860 // Indicates whether a RenderFramehost has ownership, in which case this 875 // Indicates whether a RenderFramehost has ownership, in which case this
861 // object does not self destroy. 876 // object does not self destroy.
862 bool owned_by_render_frame_host_; 877 bool owned_by_render_frame_host_;
863 878
864 // Indicates whether this RenderWidgetHost thinks is focused. This is trying 879 // Indicates whether this RenderWidgetHost thinks is focused. This is trying
865 // to match what the renderer process knows. It is different from 880 // to match what the renderer process knows. It is different from
866 // RenderWidgetHostView::HasFocus in that in that the focus request may fail, 881 // RenderWidgetHostView::HasFocus in that in that the focus request may fail,
867 // causing HasFocus to return false when is_focused_ is true. 882 // causing HasFocus to return false when is_focused_ is true.
868 bool is_focused_; 883 bool is_focused_;
869 884
(...skipping 24 matching lines...) Expand all
894 #endif 909 #endif
895 910
896 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; 911 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_;
897 912
898 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); 913 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl);
899 }; 914 };
900 915
901 } // namespace content 916 } // namespace content
902 917
903 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ 918 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698