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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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/WebFeaturePolicy.h" | 54 #include "third_party/WebKit/public/platform/WebFeaturePolicy.h" |
55 #include "third_party/WebKit/public/platform/WebFocusType.h" | 55 #include "third_party/WebKit/public/platform/WebFocusType.h" |
56 #include "third_party/WebKit/public/platform/WebLoadingBehaviorFlag.h" | 56 #include "third_party/WebKit/public/platform/WebLoadingBehaviorFlag.h" |
57 #include "third_party/WebKit/public/platform/WebMediaPlayer.h" | 57 #include "third_party/WebKit/public/platform/WebMediaPlayer.h" |
58 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h" | 58 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h" |
| 59 #include "third_party/WebKit/public/platform/site_engagement.mojom.h" |
59 #include "third_party/WebKit/public/web/WebAXObject.h" | 60 #include "third_party/WebKit/public/web/WebAXObject.h" |
60 #include "third_party/WebKit/public/web/WebDataSource.h" | 61 #include "third_party/WebKit/public/web/WebDataSource.h" |
61 #include "third_party/WebKit/public/web/WebFrameClient.h" | 62 #include "third_party/WebKit/public/web/WebFrameClient.h" |
62 #include "third_party/WebKit/public/web/WebFrameLoadType.h" | 63 #include "third_party/WebKit/public/web/WebFrameLoadType.h" |
63 #include "third_party/WebKit/public/web/WebFrameSerializerClient.h" | 64 #include "third_party/WebKit/public/web/WebFrameSerializerClient.h" |
64 #include "third_party/WebKit/public/web/WebHistoryCommitType.h" | 65 #include "third_party/WebKit/public/web/WebHistoryCommitType.h" |
65 #include "third_party/WebKit/public/web/WebMeaningfulLayout.h" | 66 #include "third_party/WebKit/public/web/WebMeaningfulLayout.h" |
66 #include "third_party/WebKit/public/web/WebScriptExecutionCallback.h" | 67 #include "third_party/WebKit/public/web/WebScriptExecutionCallback.h" |
67 #include "ui/gfx/range/range.h" | 68 #include "ui/gfx/range/range.h" |
68 #include "url/gurl.h" | 69 #include "url/gurl.h" |
| 70 #include "url/origin.h" |
69 | 71 |
70 #if BUILDFLAG(ENABLE_PLUGINS) | 72 #if BUILDFLAG(ENABLE_PLUGINS) |
71 #include "content/renderer/pepper/plugin_power_saver_helper.h" | 73 #include "content/renderer/pepper/plugin_power_saver_helper.h" |
72 #endif | 74 #endif |
73 | 75 |
74 #if defined(OS_ANDROID) | 76 #if defined(OS_ANDROID) |
75 #include "content/renderer/media/android/renderer_media_player_manager.h" | 77 #include "content/renderer/media/android/renderer_media_player_manager.h" |
76 #endif | 78 #endif |
77 | 79 |
78 struct FrameMsg_PostMessage_Params; | 80 struct FrameMsg_PostMessage_Params; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 struct ScreenInfo; | 162 struct ScreenInfo; |
161 struct StartNavigationParams; | 163 struct StartNavigationParams; |
162 struct StreamOverrideParameters; | 164 struct StreamOverrideParameters; |
163 | 165 |
164 namespace { | 166 namespace { |
165 class CreateFrameWidgetParams; | 167 class CreateFrameWidgetParams; |
166 } | 168 } |
167 | 169 |
168 class CONTENT_EXPORT RenderFrameImpl | 170 class CONTENT_EXPORT RenderFrameImpl |
169 : public RenderFrame, | 171 : public RenderFrame, |
| 172 NON_EXPORTED_BASE(blink::mojom::EngagementClient), |
170 NON_EXPORTED_BASE(mojom::Frame), | 173 NON_EXPORTED_BASE(mojom::Frame), |
171 NON_EXPORTED_BASE(mojom::HostZoom), | 174 NON_EXPORTED_BASE(mojom::HostZoom), |
172 NON_EXPORTED_BASE(public blink::WebFrameClient), | 175 NON_EXPORTED_BASE(public blink::WebFrameClient), |
173 NON_EXPORTED_BASE(public blink::WebFrameSerializerClient) { | 176 NON_EXPORTED_BASE(public blink::WebFrameSerializerClient) { |
174 public: | 177 public: |
175 // Creates a new RenderFrame as the main frame of |render_view|. | 178 // Creates a new RenderFrame as the main frame of |render_view|. |
176 static RenderFrameImpl* CreateMainFrame( | 179 static RenderFrameImpl* CreateMainFrame( |
177 RenderViewImpl* render_view, | 180 RenderViewImpl* render_view, |
178 int32_t routing_id, | 181 int32_t routing_id, |
179 int32_t widget_routing_id, | 182 int32_t widget_routing_id, |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 const gfx::Range& range) override; | 438 const gfx::Range& range) override; |
436 void EnsureMojoBuiltinsAreAvailable(v8::Isolate* isolate, | 439 void EnsureMojoBuiltinsAreAvailable(v8::Isolate* isolate, |
437 v8::Local<v8::Context> context) override; | 440 v8::Local<v8::Context> context) override; |
438 void AddMessageToConsole(ConsoleMessageLevel level, | 441 void AddMessageToConsole(ConsoleMessageLevel level, |
439 const std::string& message) override; | 442 const std::string& message) override; |
440 bool IsUsingLoFi() const override; | 443 bool IsUsingLoFi() const override; |
441 bool IsPasting() const override; | 444 bool IsPasting() const override; |
442 blink::WebPageVisibilityState GetVisibilityState() const override; | 445 blink::WebPageVisibilityState GetVisibilityState() const override; |
443 bool IsBrowserSideNavigationPending() override; | 446 bool IsBrowserSideNavigationPending() override; |
444 | 447 |
| 448 // blink::mojom::EngagementClient implementation: |
| 449 void SetEngagementLevel(const url::Origin& origin, |
| 450 blink::mojom::EngagementLevel level) override; |
| 451 |
445 // mojom::Frame implementation: | 452 // mojom::Frame implementation: |
446 void GetInterfaceProvider( | 453 void GetInterfaceProvider( |
447 service_manager::mojom::InterfaceProviderRequest request) override; | 454 service_manager::mojom::InterfaceProviderRequest request) override; |
448 | 455 |
449 // mojom::HostZoom implementation: | 456 // mojom::HostZoom implementation: |
450 void SetHostZoomLevel(const GURL& url, double zoom_level) override; | 457 void SetHostZoomLevel(const GURL& url, double zoom_level) override; |
451 | 458 |
452 // blink::WebFrameClient implementation: | 459 // blink::WebFrameClient implementation: |
453 blink::WebPlugin* createPlugin(blink::WebLocalFrame* frame, | 460 blink::WebPlugin* createPlugin(blink::WebLocalFrame* frame, |
454 const blink::WebPluginParams& params) override; | 461 const blink::WebPluginParams& params) override; |
(...skipping 188 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 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1319 PepperPluginInstanceImpl* focused_pepper_plugin_; | 1330 PepperPluginInstanceImpl* focused_pepper_plugin_; |
1320 | 1331 |
1321 // The plugin instance that received the last mouse event. It is set to NULL | 1332 // The plugin instance that received the last mouse event. It is set to NULL |
1322 // if the last mouse event went to elements other than Pepper plugins. | 1333 // if the last mouse event went to elements other than Pepper plugins. |
1323 // |pepper_last_mouse_event_target_| is not owned by this class. We depend on | 1334 // |pepper_last_mouse_event_target_| is not owned by this class. We depend on |
1324 // the RenderFrameImpl to NULL it out when it destructs. | 1335 // the RenderFrameImpl to NULL it out when it destructs. |
1325 PepperPluginInstanceImpl* pepper_last_mouse_event_target_; | 1336 PepperPluginInstanceImpl* pepper_last_mouse_event_target_; |
1326 #endif | 1337 #endif |
1327 | 1338 |
1328 HostZoomLevels host_zoom_levels_; | 1339 HostZoomLevels host_zoom_levels_; |
| 1340 EngagementLevels engagement_levels_; |
1329 | 1341 |
| 1342 mojo::AssociatedBinding<blink::mojom::EngagementClient> engagement_binding_; |
1330 mojo::Binding<mojom::Frame> frame_binding_; | 1343 mojo::Binding<mojom::Frame> frame_binding_; |
1331 mojo::AssociatedBinding<mojom::HostZoom> host_zoom_binding_; | 1344 mojo::AssociatedBinding<mojom::HostZoom> host_zoom_binding_; |
1332 mojom::FrameHostPtr frame_host_; | 1345 mojom::FrameHostPtr frame_host_; |
1333 | 1346 |
1334 // Indicates whether |didAccessInitialDocument| was called. | 1347 // Indicates whether |didAccessInitialDocument| was called. |
1335 bool has_accessed_initial_document_; | 1348 bool has_accessed_initial_document_; |
1336 | 1349 |
1337 AssociatedInterfaceRegistryImpl associated_interfaces_; | 1350 AssociatedInterfaceRegistryImpl associated_interfaces_; |
1338 std::unique_ptr<AssociatedInterfaceProviderImpl> | 1351 std::unique_ptr<AssociatedInterfaceProviderImpl> |
1339 remote_associated_interfaces_; | 1352 remote_associated_interfaces_; |
1340 | 1353 |
1341 // TODO(dcheng): Remove these members. | 1354 // TODO(dcheng): Remove these members. |
1342 bool committed_first_load_ = false; | 1355 bool committed_first_load_ = false; |
1343 bool name_changed_before_first_commit_ = false; | 1356 bool name_changed_before_first_commit_ = false; |
1344 | 1357 |
1345 bool browser_side_navigation_pending_ = false; | 1358 bool browser_side_navigation_pending_ = false; |
1346 | 1359 |
1347 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; | 1360 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; |
1348 | 1361 |
1349 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); | 1362 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); |
1350 }; | 1363 }; |
1351 | 1364 |
1352 } // namespace content | 1365 } // namespace content |
1353 | 1366 |
1354 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ | 1367 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ |
OLD | NEW |