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

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: Remove PendingSnapshotFromSurfaceMap 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 // Notification that the screen info has changed. 201 // Notification that the screen info has changed.
201 void NotifyScreenInfoChanged(); 202 void NotifyScreenInfoChanged();
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);
dgozman 2017/03/09 23:17:36 Let's just add |from_surface| parameter here and c
dvallet 2017/03/10 00:07:27 Done.
212 void GetSurfaceSnapshotFromBrowser(
213 const GetSnapshotFromBrowserCallback& callback);
211 214
212 const NativeWebKeyboardEvent* GetLastKeyboardEvent() const; 215 const NativeWebKeyboardEvent* GetLastKeyboardEvent() const;
213 216
214 // Sets the View of this RenderWidgetHost. 217 // Sets the View of this RenderWidgetHost.
215 void SetView(RenderWidgetHostViewBase* view); 218 void SetView(RenderWidgetHostViewBase* view);
216 219
217 RenderWidgetHostDelegate* delegate() const { return delegate_; } 220 RenderWidgetHostDelegate* delegate() const { return delegate_; }
218 221
219 bool empty() const { return current_size_.IsEmpty(); } 222 bool empty() const { return current_size_.IsEmpty(); }
220 223
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
688 void OnUnexpectedEventAck(UnexpectedEventAckType type) override; 691 void OnUnexpectedEventAck(UnexpectedEventAckType type) override;
689 692
690 void OnSyntheticGestureCompleted(SyntheticGesture::Result result); 693 void OnSyntheticGestureCompleted(SyntheticGesture::Result result);
691 694
692 // Called when there is a new auto resize (using a post to avoid a stack 695 // Called when there is a new auto resize (using a post to avoid a stack
693 // which may get in recursive loops). 696 // which may get in recursive loops).
694 void DelayedAutoResized(); 697 void DelayedAutoResized();
695 698
696 void WindowSnapshotReachedScreen(int snapshot_id); 699 void WindowSnapshotReachedScreen(int snapshot_id);
697 700
701 void OnSnapshotFromSurfaceReceived(int snapshot_id,
702 int retry_count,
703 const SkBitmap& bitmap,
704 ReadbackResponse response);
705
698 void OnSnapshotReceived(int snapshot_id, const gfx::Image& image); 706 void OnSnapshotReceived(int snapshot_id, const gfx::Image& image);
699 707
700 // 1. Grants permissions to URL (if any) 708 // 1. Grants permissions to URL (if any)
701 // 2. Grants permissions to filenames 709 // 2. Grants permissions to filenames
702 // 3. Grants permissions to file system files. 710 // 3. Grants permissions to file system files.
703 // 4. Register the files with the IsolatedContext. 711 // 4. Register the files with the IsolatedContext.
704 void GrantFileAccessFromDropData(DropData* drop_data); 712 void GrantFileAccessFromDropData(DropData* drop_data);
705 713
706 // true if a renderer has once been valid. We use this flag to display a sad 714 // true if a renderer has once been valid. We use this flag to display a sad
707 // tab only when we lose our renderer and not if a paint occurs during 715 // tab only when we lose our renderer and not if a paint occurs during
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 // it should not be possible to interleave other navigations in between 859 // it should not be possible to interleave other navigations in between
852 // receipt of those messages (unless FirstPaintAfterLoad is prevented from 860 // receipt of those messages (unless FirstPaintAfterLoad is prevented from
853 // being sent, in which case the timer should fire). 861 // being sent, in which case the timer should fire).
854 bool received_paint_after_load_; 862 bool received_paint_after_load_;
855 863
856 RenderWidgetHostLatencyTracker latency_tracker_; 864 RenderWidgetHostLatencyTracker latency_tracker_;
857 865
858 int next_browser_snapshot_id_; 866 int next_browser_snapshot_id_;
859 using PendingSnapshotMap = std::map<int, GetSnapshotFromBrowserCallback>; 867 using PendingSnapshotMap = std::map<int, GetSnapshotFromBrowserCallback>;
860 PendingSnapshotMap pending_browser_snapshots_; 868 PendingSnapshotMap pending_browser_snapshots_;
869 PendingSnapshotMap pending_surface_browser_snapshots_;
861 870
862 // Indicates whether a RenderFramehost has ownership, in which case this 871 // Indicates whether a RenderFramehost has ownership, in which case this
863 // object does not self destroy. 872 // object does not self destroy.
864 bool owned_by_render_frame_host_; 873 bool owned_by_render_frame_host_;
865 874
866 // Indicates whether this RenderWidgetHost thinks is focused. This is trying 875 // Indicates whether this RenderWidgetHost thinks is focused. This is trying
867 // to match what the renderer process knows. It is different from 876 // to match what the renderer process knows. It is different from
868 // RenderWidgetHostView::HasFocus in that in that the focus request may fail, 877 // RenderWidgetHostView::HasFocus in that in that the focus request may fail,
869 // causing HasFocus to return false when is_focused_ is true. 878 // causing HasFocus to return false when is_focused_ is true.
870 bool is_focused_; 879 bool is_focused_;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
904 #endif 913 #endif
905 914
906 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; 915 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_;
907 916
908 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); 917 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl);
909 }; 918 };
910 919
911 } // namespace content 920 } // namespace content
912 921
913 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ 922 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/devtools/protocol/page_handler.cc ('k') | content/browser/renderer_host/render_widget_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698