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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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); |
| 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 Loading... | |
| 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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_; |
| 861 | 869 |
| 870 using PendingSnapshotFromSurfaceMap = | |
| 871 std::map<int, GetSnapshotFromBrowserCallback>; | |
| 872 PendingSnapshotFromSurfaceMap pending_surface_browser_snapshots_; | |
|
Eric Seckler
2017/03/09 09:55:22
nit: could be PendingSnapshotMap now, too.
dvallet
2017/03/09 22:43:52
Done.
| |
| 873 | |
| 862 // Indicates whether a RenderFramehost has ownership, in which case this | 874 // Indicates whether a RenderFramehost has ownership, in which case this |
| 863 // object does not self destroy. | 875 // object does not self destroy. |
| 864 bool owned_by_render_frame_host_; | 876 bool owned_by_render_frame_host_; |
| 865 | 877 |
| 866 // Indicates whether this RenderWidgetHost thinks is focused. This is trying | 878 // Indicates whether this RenderWidgetHost thinks is focused. This is trying |
| 867 // to match what the renderer process knows. It is different from | 879 // to match what the renderer process knows. It is different from |
| 868 // RenderWidgetHostView::HasFocus in that in that the focus request may fail, | 880 // RenderWidgetHostView::HasFocus in that in that the focus request may fail, |
| 869 // causing HasFocus to return false when is_focused_ is true. | 881 // causing HasFocus to return false when is_focused_ is true. |
| 870 bool is_focused_; | 882 bool is_focused_; |
| 871 | 883 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 904 #endif | 916 #endif |
| 905 | 917 |
| 906 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; | 918 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; |
| 907 | 919 |
| 908 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 920 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
| 909 }; | 921 }; |
| 910 | 922 |
| 911 } // namespace content | 923 } // namespace content |
| 912 | 924 |
| 913 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 925 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
| OLD | NEW |