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_RENDERER_RENDER_VIEW_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
6 #define CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 6 #define CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
91 struct WebWindowFeatures; | 91 struct WebWindowFeatures; |
92 | 92 |
93 #if defined(OS_ANDROID) | 93 #if defined(OS_ANDROID) |
94 class WebHitTestResult; | 94 class WebHitTestResult; |
95 #endif | 95 #endif |
96 } // namespace blink | 96 } // namespace blink |
97 | 97 |
98 namespace content { | 98 namespace content { |
99 | 99 |
100 class HistoryController; | 100 class HistoryController; |
101 class RendererDateTimePicker; | |
101 class RenderViewImplTest; | 102 class RenderViewImplTest; |
102 class RenderViewObserver; | 103 class RenderViewObserver; |
103 class RenderViewTest; | 104 class RenderViewTest; |
104 class RendererDateTimePicker; | 105 class RenderWidgetFullscreen; |
dcheng
2016/11/21 11:19:52
Is this needed?
ncarter (slow)
2016/11/21 19:51:24
Done.
| |
105 class SpeechRecognitionDispatcher; | 106 class SpeechRecognitionDispatcher; |
106 struct FaviconURL; | 107 struct FaviconURL; |
107 struct FileChooserParams; | 108 struct FileChooserParams; |
108 struct ResizeParams; | 109 struct ResizeParams; |
109 | 110 |
110 namespace mojom { | 111 namespace mojom { |
111 class CreateViewParams; | 112 class CreateViewParams; |
112 } | 113 } |
113 | 114 |
114 // | 115 // |
115 // RenderView is an object that manages a WebView object, and provides a | 116 // RenderView is an object that manages a WebView object, and provides a |
116 // communication interface with an embedding application process. | 117 // communication interface with an embedding application process. |
117 // | 118 // |
118 // DEPRECATED: RenderViewImpl is being removed as part of the SiteIsolation | 119 // DEPRECATED: RenderViewImpl is being removed as part of the SiteIsolation |
119 // project. New code should be added to RenderFrameImpl instead. | 120 // project. New code should be added to RenderFrameImpl instead. |
120 // | 121 // |
121 // For context, please see https://crbug.com/467770 and | 122 // For context, please see https://crbug.com/467770 and |
122 // http://www.chromium.org/developers/design-documents/site-isolation. | 123 // http://www.chromium.org/developers/design-documents/site-isolation. |
123 class CONTENT_EXPORT RenderViewImpl | 124 class CONTENT_EXPORT RenderViewImpl |
124 : public RenderWidget, | 125 : public RenderWidget, |
125 NON_EXPORTED_BASE(public blink::WebViewClient), | 126 NON_EXPORTED_BASE(public blink::WebViewClient), |
126 public RenderWidgetOwnerDelegate, | 127 public RenderWidgetOwnerDelegate, |
127 public RenderView, | 128 public RenderView, |
128 public base::SupportsWeakPtr<RenderViewImpl> { | 129 public base::SupportsWeakPtr<RenderViewImpl> { |
129 public: | 130 public: |
130 // Creates a new RenderView. |opener_id| is the routing ID of the RenderView | 131 // Creates a new RenderView. Note that if the original opener has been closed, |
131 // responsible for creating this RenderView. Note that if the original opener | 132 // |params.window_was_created_with_opener| will be true and |
132 // has been closed, |window_was_created_with_opener| will be true and | 133 // |params.opener_frame_route_id| will be MSG_ROUTING_NONE. When |
133 // |opener_id| will be MSG_ROUTING_NONE. When |swapped_out| is true, the | 134 // |params.swapped_out| is true, |params.proxy_routing_id| is specified, so a |
134 // |proxy_routing_id| is specified, so a RenderFrameProxy can be created for | 135 // RenderFrameProxy can be created for this RenderView's main RenderFrame. The |
135 // this RenderView's main RenderFrame. | 136 // opener should provide a non-null value for |show_callback| if it needs to |
136 static RenderViewImpl* Create(CompositorDependencies* compositor_deps, | 137 // send an additional IPC to finish making this view visible. |
137 const mojom::CreateViewParams& params, | 138 static RenderViewImpl* Create( |
138 bool was_created_by_renderer); | 139 CompositorDependencies* compositor_deps, |
140 const mojom::CreateViewParams& params, | |
141 const RenderWidget::ShowCallback& show_callback); | |
139 | 142 |
140 // Used by content_layouttest_support to hook into the creation of | 143 // Used by content_layouttest_support to hook into the creation of |
141 // RenderViewImpls. | 144 // RenderViewImpls. |
142 static void InstallCreateHook(RenderViewImpl* (*create_render_view_impl)( | 145 static void InstallCreateHook(RenderViewImpl* (*create_render_view_impl)( |
143 CompositorDependencies* compositor_deps, | 146 CompositorDependencies* compositor_deps, |
144 const mojom::CreateViewParams&)); | 147 const mojom::CreateViewParams&)); |
145 | 148 |
146 // Returns the RenderViewImpl containing the given WebView. | 149 // Returns the RenderViewImpl containing the given WebView. |
147 static RenderViewImpl* FromWebView(blink::WebView* webview); | 150 static RenderViewImpl* FromWebView(blink::WebView* webview); |
148 | 151 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
217 const blink::WebActiveWheelFlingParameters& params); | 220 const blink::WebActiveWheelFlingParameters& params); |
218 | 221 |
219 // Starts a timer to send an UpdateState message on behalf of |frame|, if the | 222 // Starts a timer to send an UpdateState message on behalf of |frame|, if the |
220 // timer isn't already running. This allows multiple state changing events to | 223 // timer isn't already running. This allows multiple state changing events to |
221 // be coalesced into one update. | 224 // be coalesced into one update. |
222 void StartNavStateSyncTimerIfNecessary(RenderFrameImpl* frame); | 225 void StartNavStateSyncTimerIfNecessary(RenderFrameImpl* frame); |
223 | 226 |
224 // Synchronously sends the current navigation state to the browser. | 227 // Synchronously sends the current navigation state to the browser. |
225 void SendUpdateState(); | 228 void SendUpdateState(); |
226 | 229 |
230 // A popup widget opened by this view needs to be shown. | |
231 void ShowCreatedPopupWidget(RenderWidget* popup_widget, | |
232 blink::WebNavigationPolicy policy, | |
233 const gfx::Rect& initial_rect); | |
234 // A RenderWidgetFullscreen widget opened by this view needs to be shown. | |
235 void ShowCreatedFullscreenWidget(RenderWidget* fullscreen_widget, | |
236 blink::WebNavigationPolicy policy, | |
237 const gfx::Rect& initial_rect); | |
238 // A RenderView widget opened by this view needs to be shown. | |
239 void ShowCreatedViewWidget(bool opened_by_user_gesture, | |
240 RenderWidget* render_view, | |
241 blink::WebNavigationPolicy policy, | |
242 const gfx::Rect& initial_rect); | |
243 | |
227 // Returns the length of the session history of this RenderView. Note that | 244 // Returns the length of the session history of this RenderView. Note that |
228 // this only coincides with the actual length of the session history if this | 245 // this only coincides with the actual length of the session history if this |
229 // RenderView is the currently active RenderView of a WebContents. | 246 // RenderView is the currently active RenderView of a WebContents. |
230 unsigned GetLocalSessionHistoryLengthForTesting() const; | 247 unsigned GetLocalSessionHistoryLengthForTesting() const; |
231 | 248 |
232 // Invokes OnSetFocus and marks the widget as active depending on the value | 249 // Invokes OnSetFocus and marks the widget as active depending on the value |
233 // of |enable|. This is used for layout tests that need to control the focus | 250 // of |enable|. This is used for layout tests that need to control the focus |
234 // synchronously from the renderer. | 251 // synchronously from the renderer. |
235 void SetFocusAndActivateForTesting(bool enable); | 252 void SetFocusAndActivateForTesting(bool enable); |
236 | 253 |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
400 void OnOrientationChange() override; | 417 void OnOrientationChange() override; |
401 void DidCommitCompositorFrame() override; | 418 void DidCommitCompositorFrame() override; |
402 void DidCompletePageScaleAnimation() override; | 419 void DidCompletePageScaleAnimation() override; |
403 void OnDeviceScaleFactorChanged() override; | 420 void OnDeviceScaleFactorChanged() override; |
404 void ResizeWebWidget() override; | 421 void ResizeWebWidget() override; |
405 | 422 |
406 RenderViewImpl(CompositorDependencies* compositor_deps, | 423 RenderViewImpl(CompositorDependencies* compositor_deps, |
407 const mojom::CreateViewParams& params); | 424 const mojom::CreateViewParams& params); |
408 | 425 |
409 void Initialize(const mojom::CreateViewParams& params, | 426 void Initialize(const mojom::CreateViewParams& params, |
410 bool was_created_by_renderer); | 427 const RenderWidget::ShowCallback& show_callback); |
411 void SetScreenMetricsEmulationParameters( | 428 void SetScreenMetricsEmulationParameters( |
412 bool enabled, | 429 bool enabled, |
413 const blink::WebDeviceEmulationParams& params) override; | 430 const blink::WebDeviceEmulationParams& params) override; |
414 | 431 |
415 // Do not delete directly. This class is reference counted. | 432 // Do not delete directly. This class is reference counted. |
416 ~RenderViewImpl() override; | 433 ~RenderViewImpl() override; |
417 | 434 |
418 private: | 435 private: |
419 // For unit tests. | 436 // For unit tests. |
420 friend class DevToolsAgentTest; | 437 friend class DevToolsAgentTest; |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
693 // because if the view grows beyond a size known to the browser, scroll bars | 710 // because if the view grows beyond a size known to the browser, scroll bars |
694 // should be drawn. | 711 // should be drawn. |
695 gfx::Size disable_scrollbars_size_limit_; | 712 gfx::Size disable_scrollbars_size_limit_; |
696 | 713 |
697 // Loading state ------------------------------------------------------------- | 714 // Loading state ------------------------------------------------------------- |
698 | 715 |
699 // The gesture that initiated the current navigation. | 716 // The gesture that initiated the current navigation. |
700 // TODO(nasko): Move to RenderFrame, as this is per-frame state. | 717 // TODO(nasko): Move to RenderFrame, as this is per-frame state. |
701 NavigationGesture navigation_gesture_; | 718 NavigationGesture navigation_gesture_; |
702 | 719 |
703 // Used for popups. | |
704 bool opened_by_user_gesture_; | |
705 | |
706 // Timer used to delay the updating of nav state (see | 720 // Timer used to delay the updating of nav state (see |
707 // StartNavStateSyncTimerIfNecessary). | 721 // StartNavStateSyncTimerIfNecessary). |
708 base::OneShotTimer nav_state_sync_timer_; | 722 base::OneShotTimer nav_state_sync_timer_; |
709 | 723 |
710 // Set of RenderFrame routing IDs for frames that having pending UpdateState | 724 // Set of RenderFrame routing IDs for frames that having pending UpdateState |
711 // messages to send when the next |nav_state_sync_timer_| fires. | 725 // messages to send when the next |nav_state_sync_timer_| fires. |
712 std::set<int> frames_with_pending_state_; | 726 std::set<int> frames_with_pending_state_; |
713 | 727 |
714 // History list -------------------------------------------------------------- | 728 // History list -------------------------------------------------------------- |
715 | 729 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
820 // Expected id of the next content intent launched. Used to prevent scheduled | 834 // Expected id of the next content intent launched. Used to prevent scheduled |
821 // intents to be launched if aborted. | 835 // intents to be launched if aborted. |
822 size_t expected_content_intent_id_; | 836 size_t expected_content_intent_id_; |
823 | 837 |
824 // List of click-based content detectors. | 838 // List of click-based content detectors. |
825 std::vector<std::unique_ptr<ContentDetector>> content_detectors_; | 839 std::vector<std::unique_ptr<ContentDetector>> content_detectors_; |
826 | 840 |
827 // A date/time picker object for date and time related input elements. | 841 // A date/time picker object for date and time related input elements. |
828 std::unique_ptr<RendererDateTimePicker> date_time_picker_client_; | 842 std::unique_ptr<RendererDateTimePicker> date_time_picker_client_; |
829 | 843 |
844 // Whether this was a renderer-created or browser-created RenderView. | |
845 bool was_created_by_renderer_; | |
830 #endif | 846 #endif |
831 | 847 |
832 // Misc ---------------------------------------------------------------------- | 848 // Misc ---------------------------------------------------------------------- |
833 | 849 |
834 // The current directory enumeration callback | 850 // The current directory enumeration callback |
835 std::map<int, blink::WebFileChooserCompletion*> enumeration_completions_; | 851 std::map<int, blink::WebFileChooserCompletion*> enumeration_completions_; |
836 int enumeration_completion_id_; | 852 int enumeration_completion_id_; |
837 | 853 |
838 // The SessionStorage namespace that we're assigned to has an ID, and that ID | 854 // The SessionStorage namespace that we're assigned to has an ID, and that ID |
839 // is passed to us upon creation. WebKit asks for this ID upon first use and | 855 // is passed to us upon creation. WebKit asks for this ID upon first use and |
(...skipping 21 matching lines...) Expand all Loading... | |
861 // use the Observer interface to filter IPC messages and receive frame change | 877 // use the Observer interface to filter IPC messages and receive frame change |
862 // notifications. | 878 // notifications. |
863 // --------------------------------------------------------------------------- | 879 // --------------------------------------------------------------------------- |
864 | 880 |
865 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); | 881 DISALLOW_COPY_AND_ASSIGN(RenderViewImpl); |
866 }; | 882 }; |
867 | 883 |
868 } // namespace content | 884 } // namespace content |
869 | 885 |
870 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ | 886 #endif // CONTENT_RENDERER_RENDER_VIEW_IMPL_H_ |
OLD | NEW |