Chromium Code Reviews| 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_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 Loading... | |
| 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 Loading... | |
| 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 GetSurfaceSnapshotFromBrowserCallback = | |
| 214 base::Callback<void(const SkBitmap&)>; | |
| 215 void GetSurfaceSnapshotFromBrowser( | |
|
dgozman
2017/03/08 19:21:36
Can we unify this with the other method by always
dvallet
2017/03/09 06:19:47
Done.
| |
| 216 const GetSurfaceSnapshotFromBrowserCallback& 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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 688 void OnUnexpectedEventAck(UnexpectedEventAckType type) override; | 694 void OnUnexpectedEventAck(UnexpectedEventAckType type) override; |
| 689 | 695 |
| 690 void OnSyntheticGestureCompleted(SyntheticGesture::Result result); | 696 void OnSyntheticGestureCompleted(SyntheticGesture::Result result); |
| 691 | 697 |
| 692 // Called when there is a new auto resize (using a post to avoid a stack | 698 // Called when there is a new auto resize (using a post to avoid a stack |
| 693 // which may get in recursive loops). | 699 // which may get in recursive loops). |
| 694 void DelayedAutoResized(); | 700 void DelayedAutoResized(); |
| 695 | 701 |
| 696 void WindowSnapshotReachedScreen(int snapshot_id); | 702 void WindowSnapshotReachedScreen(int snapshot_id); |
| 697 | 703 |
| 704 void OnSnapshotFromSurfaceReceived(int snapshot_id, | |
| 705 int retry_count, | |
| 706 const SkBitmap& bitmap, | |
| 707 ReadbackResponse response); | |
| 708 | |
| 698 void OnSnapshotReceived(int snapshot_id, const gfx::Image& image); | 709 void OnSnapshotReceived(int snapshot_id, const gfx::Image& image); |
| 699 | 710 |
| 700 // 1. Grants permissions to URL (if any) | 711 // 1. Grants permissions to URL (if any) |
| 701 // 2. Grants permissions to filenames | 712 // 2. Grants permissions to filenames |
| 702 // 3. Grants permissions to file system files. | 713 // 3. Grants permissions to file system files. |
| 703 // 4. Register the files with the IsolatedContext. | 714 // 4. Register the files with the IsolatedContext. |
| 704 void GrantFileAccessFromDropData(DropData* drop_data); | 715 void GrantFileAccessFromDropData(DropData* drop_data); |
| 705 | 716 |
| 706 // true if a renderer has once been valid. We use this flag to display a sad | 717 // 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 | 718 // 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 Loading... | |
| 852 // receipt of those messages (unless FirstPaintAfterLoad is prevented from | 863 // receipt of those messages (unless FirstPaintAfterLoad is prevented from |
| 853 // being sent, in which case the timer should fire). | 864 // being sent, in which case the timer should fire). |
| 854 bool received_paint_after_load_; | 865 bool received_paint_after_load_; |
| 855 | 866 |
| 856 RenderWidgetHostLatencyTracker latency_tracker_; | 867 RenderWidgetHostLatencyTracker latency_tracker_; |
| 857 | 868 |
| 858 int next_browser_snapshot_id_; | 869 int next_browser_snapshot_id_; |
| 859 using PendingSnapshotMap = std::map<int, GetSnapshotFromBrowserCallback>; | 870 using PendingSnapshotMap = std::map<int, GetSnapshotFromBrowserCallback>; |
| 860 PendingSnapshotMap pending_browser_snapshots_; | 871 PendingSnapshotMap pending_browser_snapshots_; |
| 861 | 872 |
| 873 using PendingSnapshotFromSurfaceMap = | |
| 874 std::map<int, GetSurfaceSnapshotFromBrowserCallback>; | |
| 875 PendingSnapshotFromSurfaceMap pending_surface_browser_snapshots_; | |
| 876 | |
| 862 // Indicates whether a RenderFramehost has ownership, in which case this | 877 // Indicates whether a RenderFramehost has ownership, in which case this |
| 863 // object does not self destroy. | 878 // object does not self destroy. |
| 864 bool owned_by_render_frame_host_; | 879 bool owned_by_render_frame_host_; |
| 865 | 880 |
| 866 // Indicates whether this RenderWidgetHost thinks is focused. This is trying | 881 // Indicates whether this RenderWidgetHost thinks is focused. This is trying |
| 867 // to match what the renderer process knows. It is different from | 882 // to match what the renderer process knows. It is different from |
| 868 // RenderWidgetHostView::HasFocus in that in that the focus request may fail, | 883 // RenderWidgetHostView::HasFocus in that in that the focus request may fail, |
| 869 // causing HasFocus to return false when is_focused_ is true. | 884 // causing HasFocus to return false when is_focused_ is true. |
| 870 bool is_focused_; | 885 bool is_focused_; |
| 871 | 886 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 904 #endif | 919 #endif |
| 905 | 920 |
| 906 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; | 921 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; |
| 907 | 922 |
| 908 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 923 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
| 909 }; | 924 }; |
| 910 | 925 |
| 911 } // namespace content | 926 } // namespace content |
| 912 | 927 |
| 913 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 928 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
| OLD | NEW |