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

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: nits 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 int key_modifiers) override; 194 int key_modifiers) override;
194 void DragSourceEndedAt(const gfx::Point& client_pt, 195 void DragSourceEndedAt(const gfx::Point& client_pt,
195 const gfx::Point& screen_pt, 196 const gfx::Point& screen_pt,
196 blink::WebDragOperation operation) override; 197 blink::WebDragOperation operation) override;
197 void DragSourceSystemDragEnded() override; 198 void DragSourceSystemDragEnded() override;
198 void FilterDropData(DropData* drop_data) override; 199 void FilterDropData(DropData* drop_data) override;
199 200
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.
205 // the Cocoa view for end-to-end testing purposes. Returns a gfx::Image that 206 // If |from_surface| is false, it will obtain the snapshot directly from the
206 // is backed by an NSImage on MacOS or by an SkBitmap otherwise. The 207 // view (On MacOS, the snapshot is taken from the Cocoa view for end-to-end
207 // gfx::Image may be empty if the snapshot failed. 208 // testing purposes).
209 // Otherwise, the snapshot is obtained from the view's surface, with no bounds
210 // defined.
211 // Returns a gfx::Image that is backed by an NSImage on MacOS or by an
212 // SkBitmap otherwise. The gfx::Image may be empty if the snapshot failed.
208 using GetSnapshotFromBrowserCallback = 213 using GetSnapshotFromBrowserCallback =
209 base::Callback<void(const gfx::Image&)>; 214 base::Callback<void(const gfx::Image&)>;
210 void GetSnapshotFromBrowser(const GetSnapshotFromBrowserCallback& callback); 215 void GetSnapshotFromBrowser(const GetSnapshotFromBrowserCallback& callback,
216 bool from_surface);
211 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
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 void OnUnexpectedEventAck(UnexpectedEventAckType type) override; 693 void OnUnexpectedEventAck(UnexpectedEventAckType type) override;
688 694
689 void OnSyntheticGestureCompleted(SyntheticGesture::Result result); 695 void OnSyntheticGestureCompleted(SyntheticGesture::Result result);
690 696
691 // Called when there is a new auto resize (using a post to avoid a stack 697 // Called when there is a new auto resize (using a post to avoid a stack
692 // which may get in recursive loops). 698 // which may get in recursive loops).
693 void DelayedAutoResized(); 699 void DelayedAutoResized();
694 700
695 void WindowSnapshotReachedScreen(int snapshot_id); 701 void WindowSnapshotReachedScreen(int snapshot_id);
696 702
703 void OnSnapshotFromSurfaceReceived(int snapshot_id,
704 int retry_count,
705 const SkBitmap& bitmap,
706 ReadbackResponse response);
707
697 void OnSnapshotReceived(int snapshot_id, const gfx::Image& image); 708 void OnSnapshotReceived(int snapshot_id, const gfx::Image& image);
698 709
699 // 1. Grants permissions to URL (if any) 710 // 1. Grants permissions to URL (if any)
700 // 2. Grants permissions to filenames 711 // 2. Grants permissions to filenames
701 // 3. Grants permissions to file system files. 712 // 3. Grants permissions to file system files.
702 // 4. Register the files with the IsolatedContext. 713 // 4. Register the files with the IsolatedContext.
703 void GrantFileAccessFromDropData(DropData* drop_data); 714 void GrantFileAccessFromDropData(DropData* drop_data);
704 715
705 // true if a renderer has once been valid. We use this flag to display a sad 716 // true if a renderer has once been valid. We use this flag to display a sad
706 // tab only when we lose our renderer and not if a paint occurs during 717 // 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
850 // it should not be possible to interleave other navigations in between 861 // it should not be possible to interleave other navigations in between
851 // receipt of those messages (unless FirstPaintAfterLoad is prevented from 862 // receipt of those messages (unless FirstPaintAfterLoad is prevented from
852 // being sent, in which case the timer should fire). 863 // being sent, in which case the timer should fire).
853 bool received_paint_after_load_; 864 bool received_paint_after_load_;
854 865
855 RenderWidgetHostLatencyTracker latency_tracker_; 866 RenderWidgetHostLatencyTracker latency_tracker_;
856 867
857 int next_browser_snapshot_id_; 868 int next_browser_snapshot_id_;
858 using PendingSnapshotMap = std::map<int, GetSnapshotFromBrowserCallback>; 869 using PendingSnapshotMap = std::map<int, GetSnapshotFromBrowserCallback>;
859 PendingSnapshotMap pending_browser_snapshots_; 870 PendingSnapshotMap pending_browser_snapshots_;
871 PendingSnapshotMap pending_surface_browser_snapshots_;
860 872
861 // Indicates whether a RenderFramehost has ownership, in which case this 873 // Indicates whether a RenderFramehost has ownership, in which case this
862 // object does not self destroy. 874 // object does not self destroy.
863 bool owned_by_render_frame_host_; 875 bool owned_by_render_frame_host_;
864 876
865 // Indicates whether this RenderWidgetHost thinks is focused. This is trying 877 // Indicates whether this RenderWidgetHost thinks is focused. This is trying
866 // to match what the renderer process knows. It is different from 878 // to match what the renderer process knows. It is different from
867 // RenderWidgetHostView::HasFocus in that in that the focus request may fail, 879 // RenderWidgetHostView::HasFocus in that in that the focus request may fail,
868 // causing HasFocus to return false when is_focused_ is true. 880 // causing HasFocus to return false when is_focused_ is true.
869 bool is_focused_; 881 bool is_focused_;
(...skipping 29 matching lines...) Expand all
899 #endif 911 #endif
900 912
901 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; 913 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_;
902 914
903 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); 915 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl);
904 }; 916 };
905 917
906 } // namespace content 918 } // namespace content
907 919
908 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ 920 #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