| 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 | 170 |
| 171 namespace { | 171 namespace { |
| 172 class CreateFrameWidgetParams; | 172 class CreateFrameWidgetParams; |
| 173 } | 173 } |
| 174 | 174 |
| 175 class CONTENT_EXPORT RenderFrameImpl | 175 class CONTENT_EXPORT RenderFrameImpl |
| 176 : public RenderFrame, | 176 : public RenderFrame, |
| 177 NON_EXPORTED_BASE(blink::mojom::EngagementClient), | 177 NON_EXPORTED_BASE(blink::mojom::EngagementClient), |
| 178 NON_EXPORTED_BASE(mojom::Frame), | 178 NON_EXPORTED_BASE(mojom::Frame), |
| 179 NON_EXPORTED_BASE(mojom::HostZoom), | 179 NON_EXPORTED_BASE(mojom::HostZoom), |
| 180 NON_EXPORTED_BASE(mojom::FrameBindingsControl), |
| 180 NON_EXPORTED_BASE(public blink::WebFrameClient), | 181 NON_EXPORTED_BASE(public blink::WebFrameClient), |
| 181 NON_EXPORTED_BASE(public blink::WebFrameSerializerClient) { | 182 NON_EXPORTED_BASE(public blink::WebFrameSerializerClient) { |
| 182 public: | 183 public: |
| 183 // Creates a new RenderFrame as the main frame of |render_view|. | 184 // Creates a new RenderFrame as the main frame of |render_view|. |
| 184 static RenderFrameImpl* CreateMainFrame( | 185 static RenderFrameImpl* CreateMainFrame( |
| 185 RenderViewImpl* render_view, | 186 RenderViewImpl* render_view, |
| 186 int32_t routing_id, | 187 int32_t routing_id, |
| 187 int32_t widget_routing_id, | 188 int32_t widget_routing_id, |
| 188 bool hidden, | 189 bool hidden, |
| 189 const ScreenInfo& screen_info, | 190 const ScreenInfo& screen_info, |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 v8::Local<v8::Context> context) override; | 454 v8::Local<v8::Context> context) override; |
| 454 void AddMessageToConsole(ConsoleMessageLevel level, | 455 void AddMessageToConsole(ConsoleMessageLevel level, |
| 455 const std::string& message) override; | 456 const std::string& message) override; |
| 456 PreviewsState GetPreviewsState() const override; | 457 PreviewsState GetPreviewsState() const override; |
| 457 bool IsPasting() const override; | 458 bool IsPasting() const override; |
| 458 blink::WebPageVisibilityState GetVisibilityState() const override; | 459 blink::WebPageVisibilityState GetVisibilityState() const override; |
| 459 bool IsBrowserSideNavigationPending() override; | 460 bool IsBrowserSideNavigationPending() override; |
| 460 base::SingleThreadTaskRunner* GetTimerTaskRunner() override; | 461 base::SingleThreadTaskRunner* GetTimerTaskRunner() override; |
| 461 base::SingleThreadTaskRunner* GetLoadingTaskRunner() override; | 462 base::SingleThreadTaskRunner* GetLoadingTaskRunner() override; |
| 462 base::SingleThreadTaskRunner* GetUnthrottledTaskRunner() override; | 463 base::SingleThreadTaskRunner* GetUnthrottledTaskRunner() override; |
| 464 int GetEnabledBindings() const override; |
| 463 | 465 |
| 464 // blink::mojom::EngagementClient implementation: | 466 // blink::mojom::EngagementClient implementation: |
| 465 void SetEngagementLevel(const url::Origin& origin, | 467 void SetEngagementLevel(const url::Origin& origin, |
| 466 blink::mojom::EngagementLevel level) override; | 468 blink::mojom::EngagementLevel level) override; |
| 467 | 469 |
| 468 // mojom::Frame implementation: | 470 // mojom::Frame implementation: |
| 469 void GetInterfaceProvider( | 471 void GetInterfaceProvider( |
| 470 service_manager::mojom::InterfaceProviderRequest request) override; | 472 service_manager::mojom::InterfaceProviderRequest request) override; |
| 471 | 473 |
| 474 // mojom::FrameBindingsControl implementation: |
| 475 void AllowBindings(int32_t enabled_bindings_flags) override; |
| 476 |
| 472 // mojom::HostZoom implementation: | 477 // mojom::HostZoom implementation: |
| 473 void SetHostZoomLevel(const GURL& url, double zoom_level) override; | 478 void SetHostZoomLevel(const GURL& url, double zoom_level) override; |
| 474 | 479 |
| 475 // blink::WebFrameClient implementation: | 480 // blink::WebFrameClient implementation: |
| 476 blink::WebPlugin* createPlugin(blink::WebLocalFrame* frame, | 481 blink::WebPlugin* createPlugin(blink::WebLocalFrame* frame, |
| 477 const blink::WebPluginParams& params) override; | 482 const blink::WebPluginParams& params) override; |
| 478 blink::WebMediaPlayer* createMediaPlayer( | 483 blink::WebMediaPlayer* createMediaPlayer( |
| 479 const blink::WebMediaPlayerSource& source, | 484 const blink::WebMediaPlayerSource& source, |
| 480 blink::WebMediaPlayerClient* client, | 485 blink::WebMediaPlayerClient* client, |
| 481 blink::WebMediaPlayerEncryptedMediaClient* encrypted_client, | 486 blink::WebMediaPlayerEncryptedMediaClient* encrypted_client, |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 669 const blink::WebCString& data, | 674 const blink::WebCString& data, |
| 670 blink::WebFrameSerializerClient::FrameSerializationStatus status) | 675 blink::WebFrameSerializerClient::FrameSerializationStatus status) |
| 671 override; | 676 override; |
| 672 | 677 |
| 673 // Binds to the site engagement service in the browser. | 678 // Binds to the site engagement service in the browser. |
| 674 void BindEngagement(blink::mojom::EngagementClientAssociatedRequest request); | 679 void BindEngagement(blink::mojom::EngagementClientAssociatedRequest request); |
| 675 | 680 |
| 676 // Binds to the FrameHost in the browser. | 681 // Binds to the FrameHost in the browser. |
| 677 void BindFrame(mojom::FrameRequest request, mojom::FrameHostPtr frame_host); | 682 void BindFrame(mojom::FrameRequest request, mojom::FrameHostPtr frame_host); |
| 678 | 683 |
| 684 void BindFrameBindingsControl( |
| 685 mojom::FrameBindingsControlAssociatedRequest request); |
| 686 |
| 679 ManifestManager* manifest_manager(); | 687 ManifestManager* manifest_manager(); |
| 680 | 688 |
| 681 // TODO(creis): Remove when the only caller, the HistoryController, is no | 689 // TODO(creis): Remove when the only caller, the HistoryController, is no |
| 682 // more. | 690 // more. |
| 683 void SetPendingNavigationParams( | 691 void SetPendingNavigationParams( |
| 684 std::unique_ptr<NavigationParams> navigation_params); | 692 std::unique_ptr<NavigationParams> navigation_params); |
| 685 | 693 |
| 686 media::MediaPermission* GetMediaPermission(); | 694 media::MediaPermission* GetMediaPermission(); |
| 687 | 695 |
| 688 // Sends the current frame's navigation state to the browser. | 696 // Sends the current frame's navigation state to the browser. |
| (...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1354 // the RenderFrameImpl to NULL it out when it destructs. | 1362 // the RenderFrameImpl to NULL it out when it destructs. |
| 1355 PepperPluginInstanceImpl* pepper_last_mouse_event_target_; | 1363 PepperPluginInstanceImpl* pepper_last_mouse_event_target_; |
| 1356 #endif | 1364 #endif |
| 1357 | 1365 |
| 1358 HostZoomLevels host_zoom_levels_; | 1366 HostZoomLevels host_zoom_levels_; |
| 1359 EngagementOriginAndLevel engagement_level_; | 1367 EngagementOriginAndLevel engagement_level_; |
| 1360 | 1368 |
| 1361 mojo::AssociatedBinding<blink::mojom::EngagementClient> engagement_binding_; | 1369 mojo::AssociatedBinding<blink::mojom::EngagementClient> engagement_binding_; |
| 1362 mojo::Binding<mojom::Frame> frame_binding_; | 1370 mojo::Binding<mojom::Frame> frame_binding_; |
| 1363 mojo::AssociatedBinding<mojom::HostZoom> host_zoom_binding_; | 1371 mojo::AssociatedBinding<mojom::HostZoom> host_zoom_binding_; |
| 1372 mojo::AssociatedBinding<mojom::FrameBindingsControl> |
| 1373 frame_bindings_control_binding_; |
| 1364 mojom::FrameHostPtr frame_host_; | 1374 mojom::FrameHostPtr frame_host_; |
| 1365 | 1375 |
| 1366 // Indicates whether |didAccessInitialDocument| was called. | 1376 // Indicates whether |didAccessInitialDocument| was called. |
| 1367 bool has_accessed_initial_document_; | 1377 bool has_accessed_initial_document_; |
| 1368 | 1378 |
| 1369 AssociatedInterfaceRegistryImpl associated_interfaces_; | 1379 AssociatedInterfaceRegistryImpl associated_interfaces_; |
| 1370 std::unique_ptr<AssociatedInterfaceProviderImpl> | 1380 std::unique_ptr<AssociatedInterfaceProviderImpl> |
| 1371 remote_associated_interfaces_; | 1381 remote_associated_interfaces_; |
| 1372 | 1382 |
| 1373 // TODO(dcheng): Remove these members. | 1383 // TODO(dcheng): Remove these members. |
| 1374 bool committed_first_load_ = false; | 1384 bool committed_first_load_ = false; |
| 1375 bool name_changed_before_first_commit_ = false; | 1385 bool name_changed_before_first_commit_ = false; |
| 1376 | 1386 |
| 1377 bool browser_side_navigation_pending_ = false; | 1387 bool browser_side_navigation_pending_ = false; |
| 1378 | 1388 |
| 1389 // A bitwise OR of bindings types that have been enabled for this RenderFrame. |
| 1390 // See BindingsPolicy for details. |
| 1391 int enabled_bindings_ = 0; |
| 1392 |
| 1379 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; | 1393 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; |
| 1380 | 1394 |
| 1381 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); | 1395 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); |
| 1382 }; | 1396 }; |
| 1383 | 1397 |
| 1384 } // namespace content | 1398 } // namespace content |
| 1385 | 1399 |
| 1386 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ | 1400 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ |
| OLD | NEW |