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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 #include "mojo/public/cpp/bindings/associated_binding.h" | 47 #include "mojo/public/cpp/bindings/associated_binding.h" |
48 #include "mojo/public/cpp/bindings/binding.h" | 48 #include "mojo/public/cpp/bindings/binding.h" |
49 #include "ppapi/features/features.h" | 49 #include "ppapi/features/features.h" |
50 #include "services/service_manager/public/interfaces/connector.mojom.h" | 50 #include "services/service_manager/public/interfaces/connector.mojom.h" |
51 #include "services/service_manager/public/interfaces/interface_provider.mojom.h" | 51 #include "services/service_manager/public/interfaces/interface_provider.mojom.h" |
52 #include "third_party/WebKit/public/platform/WebEffectiveConnectionType.h" | 52 #include "third_party/WebKit/public/platform/WebEffectiveConnectionType.h" |
53 #include "third_party/WebKit/public/platform/WebFocusType.h" | 53 #include "third_party/WebKit/public/platform/WebFocusType.h" |
54 #include "third_party/WebKit/public/platform/WebLoadingBehaviorFlag.h" | 54 #include "third_party/WebKit/public/platform/WebLoadingBehaviorFlag.h" |
55 #include "third_party/WebKit/public/platform/WebMediaPlayer.h" | 55 #include "third_party/WebKit/public/platform/WebMediaPlayer.h" |
56 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h" | 56 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h" |
| 57 #include "third_party/WebKit/public/platform/site_engagement.mojom.h" |
57 #include "third_party/WebKit/public/web/WebAXObject.h" | 58 #include "third_party/WebKit/public/web/WebAXObject.h" |
58 #include "third_party/WebKit/public/web/WebDataSource.h" | 59 #include "third_party/WebKit/public/web/WebDataSource.h" |
59 #include "third_party/WebKit/public/web/WebFrameClient.h" | 60 #include "third_party/WebKit/public/web/WebFrameClient.h" |
60 #include "third_party/WebKit/public/web/WebFrameLoadType.h" | 61 #include "third_party/WebKit/public/web/WebFrameLoadType.h" |
61 #include "third_party/WebKit/public/web/WebFrameSerializerClient.h" | 62 #include "third_party/WebKit/public/web/WebFrameSerializerClient.h" |
62 #include "third_party/WebKit/public/web/WebHistoryCommitType.h" | 63 #include "third_party/WebKit/public/web/WebHistoryCommitType.h" |
63 #include "third_party/WebKit/public/web/WebMeaningfulLayout.h" | 64 #include "third_party/WebKit/public/web/WebMeaningfulLayout.h" |
64 #include "third_party/WebKit/public/web/WebScriptExecutionCallback.h" | 65 #include "third_party/WebKit/public/web/WebScriptExecutionCallback.h" |
65 #include "ui/gfx/range/range.h" | 66 #include "ui/gfx/range/range.h" |
66 #include "url/gurl.h" | 67 #include "url/gurl.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 struct ScreenInfo; | 161 struct ScreenInfo; |
161 struct StartNavigationParams; | 162 struct StartNavigationParams; |
162 struct StreamOverrideParameters; | 163 struct StreamOverrideParameters; |
163 | 164 |
164 namespace { | 165 namespace { |
165 class CreateFrameWidgetParams; | 166 class CreateFrameWidgetParams; |
166 } | 167 } |
167 | 168 |
168 class CONTENT_EXPORT RenderFrameImpl | 169 class CONTENT_EXPORT RenderFrameImpl |
169 : public RenderFrame, | 170 : public RenderFrame, |
| 171 NON_EXPORTED_BASE(blink::mojom::EngagementClient), |
170 NON_EXPORTED_BASE(mojom::Frame), | 172 NON_EXPORTED_BASE(mojom::Frame), |
171 NON_EXPORTED_BASE(mojom::HostZoom), | 173 NON_EXPORTED_BASE(mojom::HostZoom), |
172 NON_EXPORTED_BASE(public blink::WebFrameClient), | 174 NON_EXPORTED_BASE(public blink::WebFrameClient), |
173 NON_EXPORTED_BASE(public blink::WebFrameSerializerClient) { | 175 NON_EXPORTED_BASE(public blink::WebFrameSerializerClient) { |
174 public: | 176 public: |
175 // Creates a new RenderFrame as the main frame of |render_view|. | 177 // Creates a new RenderFrame as the main frame of |render_view|. |
176 static RenderFrameImpl* CreateMainFrame( | 178 static RenderFrameImpl* CreateMainFrame( |
177 RenderViewImpl* render_view, | 179 RenderViewImpl* render_view, |
178 int32_t routing_id, | 180 int32_t routing_id, |
179 int32_t widget_routing_id, | 181 int32_t widget_routing_id, |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 const gfx::Range& range) override; | 437 const gfx::Range& range) override; |
436 void EnsureMojoBuiltinsAreAvailable(v8::Isolate* isolate, | 438 void EnsureMojoBuiltinsAreAvailable(v8::Isolate* isolate, |
437 v8::Local<v8::Context> context) override; | 439 v8::Local<v8::Context> context) override; |
438 void AddMessageToConsole(ConsoleMessageLevel level, | 440 void AddMessageToConsole(ConsoleMessageLevel level, |
439 const std::string& message) override; | 441 const std::string& message) override; |
440 bool IsUsingLoFi() const override; | 442 bool IsUsingLoFi() const override; |
441 bool IsPasting() const override; | 443 bool IsPasting() const override; |
442 blink::WebPageVisibilityState GetVisibilityState() const override; | 444 blink::WebPageVisibilityState GetVisibilityState() const override; |
443 bool IsBrowserSideNavigationPending() override; | 445 bool IsBrowserSideNavigationPending() override; |
444 | 446 |
| 447 // blink::mojom::EngagementClient implementation: |
| 448 void SetEngagementLevel(blink::mojom::EngagementLevel level) override; |
| 449 |
445 // mojom::Frame implementation: | 450 // mojom::Frame implementation: |
446 void GetInterfaceProvider( | 451 void GetInterfaceProvider( |
447 service_manager::mojom::InterfaceProviderRequest request) override; | 452 service_manager::mojom::InterfaceProviderRequest request) override; |
448 | 453 |
449 // mojom::HostZoom implementation: | 454 // mojom::HostZoom implementation: |
450 void SetHostZoomLevel(const GURL& url, double zoom_level) override; | 455 void SetHostZoomLevel(const GURL& url, double zoom_level) override; |
451 | 456 |
452 // blink::WebFrameClient implementation: | 457 // blink::WebFrameClient implementation: |
453 blink::WebPlugin* createPlugin(blink::WebLocalFrame* frame, | 458 blink::WebPlugin* createPlugin(blink::WebLocalFrame* frame, |
454 const blink::WebPluginParams& params) override; | 459 const blink::WebPluginParams& params) override; |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 blink::InterfaceProvider* interfaceProvider() override; | 647 blink::InterfaceProvider* interfaceProvider() override; |
643 blink::InterfaceRegistry* interfaceRegistry() override; | 648 blink::InterfaceRegistry* interfaceRegistry() override; |
644 blink::WebPageVisibilityState visibilityState() const override; | 649 blink::WebPageVisibilityState visibilityState() const override; |
645 | 650 |
646 // WebFrameSerializerClient implementation: | 651 // WebFrameSerializerClient implementation: |
647 void didSerializeDataForFrame( | 652 void didSerializeDataForFrame( |
648 const blink::WebCString& data, | 653 const blink::WebCString& data, |
649 blink::WebFrameSerializerClient::FrameSerializationStatus status) | 654 blink::WebFrameSerializerClient::FrameSerializationStatus status) |
650 override; | 655 override; |
651 | 656 |
| 657 // Binds to the site engagement service in the browser. |
| 658 void BindEngagement(blink::mojom::EngagementClientAssociatedRequest request); |
| 659 |
652 // Binds to the FrameHost in the browser. | 660 // Binds to the FrameHost in the browser. |
653 void Bind(mojom::FrameRequest frame, mojom::FrameHostPtr frame_host); | 661 void BindFrame(mojom::FrameRequest request, mojom::FrameHostPtr frame_host); |
654 | 662 |
655 ManifestManager* manifest_manager(); | 663 ManifestManager* manifest_manager(); |
656 | 664 |
657 // TODO(creis): Remove when the only caller, the HistoryController, is no | 665 // TODO(creis): Remove when the only caller, the HistoryController, is no |
658 // more. | 666 // more. |
659 void SetPendingNavigationParams( | 667 void SetPendingNavigationParams( |
660 std::unique_ptr<NavigationParams> navigation_params); | 668 std::unique_ptr<NavigationParams> navigation_params); |
661 | 669 |
662 media::MediaPermission* GetMediaPermission(); | 670 media::MediaPermission* GetMediaPermission(); |
663 | 671 |
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1318 | 1326 |
1319 // The plugin instance that received the last mouse event. It is set to NULL | 1327 // The plugin instance that received the last mouse event. It is set to NULL |
1320 // if the last mouse event went to elements other than Pepper plugins. | 1328 // if the last mouse event went to elements other than Pepper plugins. |
1321 // |pepper_last_mouse_event_target_| is not owned by this class. We depend on | 1329 // |pepper_last_mouse_event_target_| is not owned by this class. We depend on |
1322 // the RenderFrameImpl to NULL it out when it destructs. | 1330 // the RenderFrameImpl to NULL it out when it destructs. |
1323 PepperPluginInstanceImpl* pepper_last_mouse_event_target_; | 1331 PepperPluginInstanceImpl* pepper_last_mouse_event_target_; |
1324 #endif | 1332 #endif |
1325 | 1333 |
1326 HostZoomLevels host_zoom_levels_; | 1334 HostZoomLevels host_zoom_levels_; |
1327 | 1335 |
| 1336 mojo::AssociatedBinding<blink::mojom::EngagementClient> engagement_binding_; |
1328 mojo::Binding<mojom::Frame> frame_binding_; | 1337 mojo::Binding<mojom::Frame> frame_binding_; |
1329 mojo::AssociatedBinding<mojom::HostZoom> host_zoom_binding_; | 1338 mojo::AssociatedBinding<mojom::HostZoom> host_zoom_binding_; |
1330 mojom::FrameHostPtr frame_host_; | 1339 mojom::FrameHostPtr frame_host_; |
1331 | 1340 |
| 1341 // The engagement level to send to the frame once a navigation has committed. |
| 1342 blink::mojom::EngagementLevel engagement_level_; |
| 1343 |
1332 // Indicates whether |didAccessInitialDocument| was called. | 1344 // Indicates whether |didAccessInitialDocument| was called. |
1333 bool has_accessed_initial_document_; | 1345 bool has_accessed_initial_document_; |
1334 | 1346 |
1335 AssociatedInterfaceRegistryImpl associated_interfaces_; | 1347 AssociatedInterfaceRegistryImpl associated_interfaces_; |
1336 std::unique_ptr<AssociatedInterfaceProviderImpl> | 1348 std::unique_ptr<AssociatedInterfaceProviderImpl> |
1337 remote_associated_interfaces_; | 1349 remote_associated_interfaces_; |
1338 | 1350 |
1339 // TODO(dcheng): Remove these members. | 1351 // TODO(dcheng): Remove these members. |
1340 bool committed_first_load_ = false; | 1352 bool committed_first_load_ = false; |
1341 bool name_changed_before_first_commit_ = false; | 1353 bool name_changed_before_first_commit_ = false; |
1342 | 1354 |
1343 bool browser_side_navigation_pending_ = false; | 1355 bool browser_side_navigation_pending_ = false; |
1344 | 1356 |
1345 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; | 1357 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; |
1346 | 1358 |
1347 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); | 1359 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); |
1348 }; | 1360 }; |
1349 | 1361 |
1350 } // namespace content | 1362 } // namespace content |
1351 | 1363 |
1352 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ | 1364 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ |
OLD | NEW |