OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_FRAME_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ |
6 #define CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ | 6 #define CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 #include "mojo/public/cpp/bindings/associated_binding.h" | 48 #include "mojo/public/cpp/bindings/associated_binding.h" |
49 #include "mojo/public/cpp/bindings/binding.h" | 49 #include "mojo/public/cpp/bindings/binding.h" |
50 #include "ppapi/features/features.h" | 50 #include "ppapi/features/features.h" |
51 #include "services/service_manager/public/interfaces/connector.mojom.h" | 51 #include "services/service_manager/public/interfaces/connector.mojom.h" |
52 #include "services/service_manager/public/interfaces/interface_provider.mojom.h" | 52 #include "services/service_manager/public/interfaces/interface_provider.mojom.h" |
53 #include "third_party/WebKit/public/platform/WebEffectiveConnectionType.h" | 53 #include "third_party/WebKit/public/platform/WebEffectiveConnectionType.h" |
54 #include "third_party/WebKit/public/platform/WebFocusType.h" | 54 #include "third_party/WebKit/public/platform/WebFocusType.h" |
55 #include "third_party/WebKit/public/platform/WebLoadingBehaviorFlag.h" | 55 #include "third_party/WebKit/public/platform/WebLoadingBehaviorFlag.h" |
56 #include "third_party/WebKit/public/platform/WebMediaPlayer.h" | 56 #include "third_party/WebKit/public/platform/WebMediaPlayer.h" |
57 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h" | 57 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h" |
| 58 #include "third_party/WebKit/public/platform/site_engagement.mojom.h" |
58 #include "third_party/WebKit/public/web/WebAXObject.h" | 59 #include "third_party/WebKit/public/web/WebAXObject.h" |
59 #include "third_party/WebKit/public/web/WebDataSource.h" | 60 #include "third_party/WebKit/public/web/WebDataSource.h" |
60 #include "third_party/WebKit/public/web/WebFrameClient.h" | 61 #include "third_party/WebKit/public/web/WebFrameClient.h" |
61 #include "third_party/WebKit/public/web/WebFrameLoadType.h" | 62 #include "third_party/WebKit/public/web/WebFrameLoadType.h" |
62 #include "third_party/WebKit/public/web/WebFrameSerializerClient.h" | 63 #include "third_party/WebKit/public/web/WebFrameSerializerClient.h" |
63 #include "third_party/WebKit/public/web/WebHistoryCommitType.h" | 64 #include "third_party/WebKit/public/web/WebHistoryCommitType.h" |
64 #include "third_party/WebKit/public/web/WebMeaningfulLayout.h" | 65 #include "third_party/WebKit/public/web/WebMeaningfulLayout.h" |
65 #include "third_party/WebKit/public/web/WebScriptExecutionCallback.h" | 66 #include "third_party/WebKit/public/web/WebScriptExecutionCallback.h" |
66 #include "ui/gfx/range/range.h" | 67 #include "ui/gfx/range/range.h" |
67 #include "url/gurl.h" | 68 #include "url/gurl.h" |
| 69 #include "url/origin.h" |
68 | 70 |
69 #if BUILDFLAG(ENABLE_PLUGINS) | 71 #if BUILDFLAG(ENABLE_PLUGINS) |
70 #include "content/renderer/pepper/plugin_power_saver_helper.h" | 72 #include "content/renderer/pepper/plugin_power_saver_helper.h" |
71 #endif | 73 #endif |
72 | 74 |
73 #if defined(OS_ANDROID) | 75 #if defined(OS_ANDROID) |
74 #include "content/renderer/media/android/renderer_media_player_manager.h" | 76 #include "content/renderer/media/android/renderer_media_player_manager.h" |
75 #endif | 77 #endif |
76 | 78 |
77 struct FrameMsg_PostMessage_Params; | 79 struct FrameMsg_PostMessage_Params; |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 struct ScreenInfo; | 163 struct ScreenInfo; |
162 struct StartNavigationParams; | 164 struct StartNavigationParams; |
163 struct StreamOverrideParameters; | 165 struct StreamOverrideParameters; |
164 | 166 |
165 namespace { | 167 namespace { |
166 class CreateFrameWidgetParams; | 168 class CreateFrameWidgetParams; |
167 } | 169 } |
168 | 170 |
169 class CONTENT_EXPORT RenderFrameImpl | 171 class CONTENT_EXPORT RenderFrameImpl |
170 : public RenderFrame, | 172 : public RenderFrame, |
| 173 NON_EXPORTED_BASE(blink::mojom::EngagementClient), |
171 NON_EXPORTED_BASE(mojom::Frame), | 174 NON_EXPORTED_BASE(mojom::Frame), |
172 NON_EXPORTED_BASE(mojom::HostZoom), | 175 NON_EXPORTED_BASE(mojom::HostZoom), |
173 NON_EXPORTED_BASE(public blink::WebFrameClient), | 176 NON_EXPORTED_BASE(public blink::WebFrameClient), |
174 NON_EXPORTED_BASE(public blink::WebFrameSerializerClient) { | 177 NON_EXPORTED_BASE(public blink::WebFrameSerializerClient) { |
175 public: | 178 public: |
176 // Creates a new RenderFrame as the main frame of |render_view|. | 179 // Creates a new RenderFrame as the main frame of |render_view|. |
177 static RenderFrameImpl* CreateMainFrame( | 180 static RenderFrameImpl* CreateMainFrame( |
178 RenderViewImpl* render_view, | 181 RenderViewImpl* render_view, |
179 int32_t routing_id, | 182 int32_t routing_id, |
180 int32_t widget_routing_id, | 183 int32_t widget_routing_id, |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 const gfx::Range& range) override; | 439 const gfx::Range& range) override; |
437 void EnsureMojoBuiltinsAreAvailable(v8::Isolate* isolate, | 440 void EnsureMojoBuiltinsAreAvailable(v8::Isolate* isolate, |
438 v8::Local<v8::Context> context) override; | 441 v8::Local<v8::Context> context) override; |
439 void AddMessageToConsole(ConsoleMessageLevel level, | 442 void AddMessageToConsole(ConsoleMessageLevel level, |
440 const std::string& message) override; | 443 const std::string& message) override; |
441 bool IsUsingLoFi() const override; | 444 bool IsUsingLoFi() const override; |
442 bool IsPasting() const override; | 445 bool IsPasting() const override; |
443 blink::WebPageVisibilityState GetVisibilityState() const override; | 446 blink::WebPageVisibilityState GetVisibilityState() const override; |
444 bool IsBrowserSideNavigationPending() override; | 447 bool IsBrowserSideNavigationPending() override; |
445 | 448 |
| 449 // blink::mojom::EngagementClient implementation: |
| 450 void SetEngagementLevel(const url::Origin& origin, |
| 451 blink::mojom::EngagementLevel level) override; |
| 452 |
446 // mojom::Frame implementation: | 453 // mojom::Frame implementation: |
447 void GetInterfaceProvider( | 454 void GetInterfaceProvider( |
448 service_manager::mojom::InterfaceProviderRequest request) override; | 455 service_manager::mojom::InterfaceProviderRequest request) override; |
449 | 456 |
450 // mojom::HostZoom implementation: | 457 // mojom::HostZoom implementation: |
451 void SetHostZoomLevel(const GURL& url, double zoom_level) override; | 458 void SetHostZoomLevel(const GURL& url, double zoom_level) override; |
452 | 459 |
453 // blink::WebFrameClient implementation: | 460 // blink::WebFrameClient implementation: |
454 blink::WebPlugin* createPlugin(blink::WebLocalFrame* frame, | 461 blink::WebPlugin* createPlugin(blink::WebLocalFrame* frame, |
455 const blink::WebPluginParams& params) override; | 462 const blink::WebPluginParams& params) override; |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 blink::InterfaceProvider* interfaceProvider() override; | 650 blink::InterfaceProvider* interfaceProvider() override; |
644 blink::InterfaceRegistry* interfaceRegistry() override; | 651 blink::InterfaceRegistry* interfaceRegistry() override; |
645 blink::WebPageVisibilityState visibilityState() const override; | 652 blink::WebPageVisibilityState visibilityState() const override; |
646 | 653 |
647 // WebFrameSerializerClient implementation: | 654 // WebFrameSerializerClient implementation: |
648 void didSerializeDataForFrame( | 655 void didSerializeDataForFrame( |
649 const blink::WebCString& data, | 656 const blink::WebCString& data, |
650 blink::WebFrameSerializerClient::FrameSerializationStatus status) | 657 blink::WebFrameSerializerClient::FrameSerializationStatus status) |
651 override; | 658 override; |
652 | 659 |
| 660 // Binds to the site engagement service in the browser. |
| 661 void BindEngagement(blink::mojom::EngagementClientAssociatedRequest request); |
| 662 |
653 // Binds to the FrameHost in the browser. | 663 // Binds to the FrameHost in the browser. |
654 void Bind(mojom::FrameRequest frame, mojom::FrameHostPtr frame_host); | 664 void BindFrame(mojom::FrameRequest request, mojom::FrameHostPtr frame_host); |
655 | 665 |
656 ManifestManager* manifest_manager(); | 666 ManifestManager* manifest_manager(); |
657 | 667 |
658 // TODO(creis): Remove when the only caller, the HistoryController, is no | 668 // TODO(creis): Remove when the only caller, the HistoryController, is no |
659 // more. | 669 // more. |
660 void SetPendingNavigationParams( | 670 void SetPendingNavigationParams( |
661 std::unique_ptr<NavigationParams> navigation_params); | 671 std::unique_ptr<NavigationParams> navigation_params); |
662 | 672 |
663 media::MediaPermission* GetMediaPermission(); | 673 media::MediaPermission* GetMediaPermission(); |
664 | 674 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 | 752 |
743 int id_; | 753 int id_; |
744 bool notify_result_; | 754 bool notify_result_; |
745 int routing_id_; | 755 int routing_id_; |
746 base::WeakPtr<RenderFrameImpl> render_frame_impl_; | 756 base::WeakPtr<RenderFrameImpl> render_frame_impl_; |
747 | 757 |
748 DISALLOW_COPY_AND_ASSIGN(JavaScriptIsolatedWorldRequest); | 758 DISALLOW_COPY_AND_ASSIGN(JavaScriptIsolatedWorldRequest); |
749 }; | 759 }; |
750 | 760 |
751 typedef std::map<GURL, double> HostZoomLevels; | 761 typedef std::map<GURL, double> HostZoomLevels; |
| 762 typedef std::map<url::Origin, blink::mojom::EngagementLevel> EngagementLevels; |
752 | 763 |
753 // Creates a new RenderFrame. |render_view| is the RenderView object that this | 764 // Creates a new RenderFrame. |render_view| is the RenderView object that this |
754 // frame belongs to. | 765 // frame belongs to. |
755 // Callers *must* call |BindToWebFrame| immediately after creation. | 766 // Callers *must* call |BindToWebFrame| immediately after creation. |
756 static RenderFrameImpl* Create(RenderViewImpl* render_view, | 767 static RenderFrameImpl* Create(RenderViewImpl* render_view, |
757 int32_t routing_id); | 768 int32_t routing_id); |
758 | 769 |
759 // This is called right after creation with the WebLocalFrame for this | 770 // This is called right after creation with the WebLocalFrame for this |
760 // RenderFrame. It must be called before Initialize. | 771 // RenderFrame. It must be called before Initialize. |
761 void BindToWebFrame(blink::WebLocalFrame* web_frame); | 772 void BindToWebFrame(blink::WebLocalFrame* web_frame); |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1318 PepperPluginInstanceImpl* focused_pepper_plugin_; | 1329 PepperPluginInstanceImpl* focused_pepper_plugin_; |
1319 | 1330 |
1320 // The plugin instance that received the last mouse event. It is set to NULL | 1331 // The plugin instance that received the last mouse event. It is set to NULL |
1321 // if the last mouse event went to elements other than Pepper plugins. | 1332 // if the last mouse event went to elements other than Pepper plugins. |
1322 // |pepper_last_mouse_event_target_| is not owned by this class. We depend on | 1333 // |pepper_last_mouse_event_target_| is not owned by this class. We depend on |
1323 // the RenderFrameImpl to NULL it out when it destructs. | 1334 // the RenderFrameImpl to NULL it out when it destructs. |
1324 PepperPluginInstanceImpl* pepper_last_mouse_event_target_; | 1335 PepperPluginInstanceImpl* pepper_last_mouse_event_target_; |
1325 #endif | 1336 #endif |
1326 | 1337 |
1327 HostZoomLevels host_zoom_levels_; | 1338 HostZoomLevels host_zoom_levels_; |
| 1339 EngagementLevels engagement_levels_; |
1328 | 1340 |
| 1341 mojo::AssociatedBinding<blink::mojom::EngagementClient> engagement_binding_; |
1329 mojo::Binding<mojom::Frame> frame_binding_; | 1342 mojo::Binding<mojom::Frame> frame_binding_; |
1330 mojo::AssociatedBinding<mojom::HostZoom> host_zoom_binding_; | 1343 mojo::AssociatedBinding<mojom::HostZoom> host_zoom_binding_; |
1331 mojom::FrameHostPtr frame_host_; | 1344 mojom::FrameHostPtr frame_host_; |
1332 | 1345 |
1333 // Indicates whether |didAccessInitialDocument| was called. | 1346 // Indicates whether |didAccessInitialDocument| was called. |
1334 bool has_accessed_initial_document_; | 1347 bool has_accessed_initial_document_; |
1335 | 1348 |
1336 AssociatedInterfaceRegistryImpl associated_interfaces_; | 1349 AssociatedInterfaceRegistryImpl associated_interfaces_; |
1337 std::unique_ptr<AssociatedInterfaceProviderImpl> | 1350 std::unique_ptr<AssociatedInterfaceProviderImpl> |
1338 remote_associated_interfaces_; | 1351 remote_associated_interfaces_; |
1339 | 1352 |
1340 // TODO(dcheng): Remove these members. | 1353 // TODO(dcheng): Remove these members. |
1341 bool committed_first_load_ = false; | 1354 bool committed_first_load_ = false; |
1342 bool name_changed_before_first_commit_ = false; | 1355 bool name_changed_before_first_commit_ = false; |
1343 | 1356 |
1344 bool browser_side_navigation_pending_ = false; | 1357 bool browser_side_navigation_pending_ = false; |
1345 | 1358 |
1346 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; | 1359 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; |
1347 | 1360 |
1348 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); | 1361 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); |
1349 }; | 1362 }; |
1350 | 1363 |
1351 } // namespace content | 1364 } // namespace content |
1352 | 1365 |
1353 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ | 1366 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ |
OLD | NEW |