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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 | 166 |
167 namespace { | 167 namespace { |
168 class CreateFrameWidgetParams; | 168 class CreateFrameWidgetParams; |
169 } | 169 } |
170 | 170 |
171 class CONTENT_EXPORT RenderFrameImpl | 171 class CONTENT_EXPORT RenderFrameImpl |
172 : public RenderFrame, | 172 : public RenderFrame, |
173 NON_EXPORTED_BASE(blink::mojom::EngagementClient), | 173 NON_EXPORTED_BASE(blink::mojom::EngagementClient), |
174 NON_EXPORTED_BASE(mojom::Frame), | 174 NON_EXPORTED_BASE(mojom::Frame), |
175 NON_EXPORTED_BASE(mojom::HostZoom), | 175 NON_EXPORTED_BASE(mojom::HostZoom), |
| 176 NON_EXPORTED_BASE(mojom::FrameBindingsControl), |
176 NON_EXPORTED_BASE(public blink::WebFrameClient), | 177 NON_EXPORTED_BASE(public blink::WebFrameClient), |
177 NON_EXPORTED_BASE(public blink::WebFrameSerializerClient) { | 178 NON_EXPORTED_BASE(public blink::WebFrameSerializerClient) { |
178 public: | 179 public: |
179 // Creates a new RenderFrame as the main frame of |render_view|. | 180 // Creates a new RenderFrame as the main frame of |render_view|. |
180 static RenderFrameImpl* CreateMainFrame( | 181 static RenderFrameImpl* CreateMainFrame( |
181 RenderViewImpl* render_view, | 182 RenderViewImpl* render_view, |
182 int32_t routing_id, | 183 int32_t routing_id, |
183 int32_t widget_routing_id, | 184 int32_t widget_routing_id, |
184 bool hidden, | 185 bool hidden, |
185 const ScreenInfo& screen_info, | 186 const ScreenInfo& screen_info, |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 size_t offset, | 445 size_t offset, |
445 const gfx::Range& range) override; | 446 const gfx::Range& range) override; |
446 void EnsureMojoBuiltinsAreAvailable(v8::Isolate* isolate, | 447 void EnsureMojoBuiltinsAreAvailable(v8::Isolate* isolate, |
447 v8::Local<v8::Context> context) override; | 448 v8::Local<v8::Context> context) override; |
448 void AddMessageToConsole(ConsoleMessageLevel level, | 449 void AddMessageToConsole(ConsoleMessageLevel level, |
449 const std::string& message) override; | 450 const std::string& message) override; |
450 bool IsUsingLoFi() const override; | 451 bool IsUsingLoFi() const override; |
451 bool IsPasting() const override; | 452 bool IsPasting() const override; |
452 blink::WebPageVisibilityState GetVisibilityState() const override; | 453 blink::WebPageVisibilityState GetVisibilityState() const override; |
453 bool IsBrowserSideNavigationPending() override; | 454 bool IsBrowserSideNavigationPending() override; |
| 455 int GetEnabledBindings() const override; |
454 | 456 |
455 // blink::mojom::EngagementClient implementation: | 457 // blink::mojom::EngagementClient implementation: |
456 void SetEngagementLevel(const url::Origin& origin, | 458 void SetEngagementLevel(const url::Origin& origin, |
457 blink::mojom::EngagementLevel level) override; | 459 blink::mojom::EngagementLevel level) override; |
458 | 460 |
459 // mojom::Frame implementation: | 461 // mojom::Frame implementation: |
460 void GetInterfaceProvider( | 462 void GetInterfaceProvider( |
461 service_manager::mojom::InterfaceProviderRequest request) override; | 463 service_manager::mojom::InterfaceProviderRequest request) override; |
462 | 464 |
| 465 // mojom::FrameBindingsControl implementation: |
| 466 void AllowBindings(int32_t enabled_bindings_flags) override; |
| 467 |
463 // mojom::HostZoom implementation: | 468 // mojom::HostZoom implementation: |
464 void SetHostZoomLevel(const GURL& url, double zoom_level) override; | 469 void SetHostZoomLevel(const GURL& url, double zoom_level) override; |
465 | 470 |
466 // blink::WebFrameClient implementation: | 471 // blink::WebFrameClient implementation: |
467 blink::WebPlugin* createPlugin(blink::WebLocalFrame* frame, | 472 blink::WebPlugin* createPlugin(blink::WebLocalFrame* frame, |
468 const blink::WebPluginParams& params) override; | 473 const blink::WebPluginParams& params) override; |
469 blink::WebMediaPlayer* createMediaPlayer( | 474 blink::WebMediaPlayer* createMediaPlayer( |
470 const blink::WebMediaPlayerSource& source, | 475 const blink::WebMediaPlayerSource& source, |
471 blink::WebMediaPlayerClient* client, | 476 blink::WebMediaPlayerClient* client, |
472 blink::WebMediaPlayerEncryptedMediaClient* encrypted_client, | 477 blink::WebMediaPlayerEncryptedMediaClient* encrypted_client, |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 const blink::WebCString& data, | 667 const blink::WebCString& data, |
663 blink::WebFrameSerializerClient::FrameSerializationStatus status) | 668 blink::WebFrameSerializerClient::FrameSerializationStatus status) |
664 override; | 669 override; |
665 | 670 |
666 // Binds to the site engagement service in the browser. | 671 // Binds to the site engagement service in the browser. |
667 void BindEngagement(blink::mojom::EngagementClientAssociatedRequest request); | 672 void BindEngagement(blink::mojom::EngagementClientAssociatedRequest request); |
668 | 673 |
669 // Binds to the FrameHost in the browser. | 674 // Binds to the FrameHost in the browser. |
670 void BindFrame(mojom::FrameRequest request, mojom::FrameHostPtr frame_host); | 675 void BindFrame(mojom::FrameRequest request, mojom::FrameHostPtr frame_host); |
671 | 676 |
| 677 void BindFrameBindingsControl( |
| 678 mojom::FrameBindingsControlAssociatedRequest request); |
| 679 |
672 ManifestManager* manifest_manager(); | 680 ManifestManager* manifest_manager(); |
673 | 681 |
674 // TODO(creis): Remove when the only caller, the HistoryController, is no | 682 // TODO(creis): Remove when the only caller, the HistoryController, is no |
675 // more. | 683 // more. |
676 void SetPendingNavigationParams( | 684 void SetPendingNavigationParams( |
677 std::unique_ptr<NavigationParams> navigation_params); | 685 std::unique_ptr<NavigationParams> navigation_params); |
678 | 686 |
679 media::MediaPermission* GetMediaPermission(); | 687 media::MediaPermission* GetMediaPermission(); |
680 | 688 |
681 // Sends the current frame's navigation state to the browser. | 689 // Sends the current frame's navigation state to the browser. |
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1341 // the RenderFrameImpl to NULL it out when it destructs. | 1349 // the RenderFrameImpl to NULL it out when it destructs. |
1342 PepperPluginInstanceImpl* pepper_last_mouse_event_target_; | 1350 PepperPluginInstanceImpl* pepper_last_mouse_event_target_; |
1343 #endif | 1351 #endif |
1344 | 1352 |
1345 HostZoomLevels host_zoom_levels_; | 1353 HostZoomLevels host_zoom_levels_; |
1346 EngagementLevels engagement_levels_; | 1354 EngagementLevels engagement_levels_; |
1347 | 1355 |
1348 mojo::AssociatedBinding<blink::mojom::EngagementClient> engagement_binding_; | 1356 mojo::AssociatedBinding<blink::mojom::EngagementClient> engagement_binding_; |
1349 mojo::Binding<mojom::Frame> frame_binding_; | 1357 mojo::Binding<mojom::Frame> frame_binding_; |
1350 mojo::AssociatedBinding<mojom::HostZoom> host_zoom_binding_; | 1358 mojo::AssociatedBinding<mojom::HostZoom> host_zoom_binding_; |
| 1359 mojo::AssociatedBinding<mojom::FrameBindingsControl> |
| 1360 frame_bindings_control_binding_; |
1351 mojom::FrameHostPtr frame_host_; | 1361 mojom::FrameHostPtr frame_host_; |
1352 | 1362 |
1353 // Indicates whether |didAccessInitialDocument| was called. | 1363 // Indicates whether |didAccessInitialDocument| was called. |
1354 bool has_accessed_initial_document_; | 1364 bool has_accessed_initial_document_; |
1355 | 1365 |
1356 AssociatedInterfaceRegistryImpl associated_interfaces_; | 1366 AssociatedInterfaceRegistryImpl associated_interfaces_; |
1357 std::unique_ptr<AssociatedInterfaceProviderImpl> | 1367 std::unique_ptr<AssociatedInterfaceProviderImpl> |
1358 remote_associated_interfaces_; | 1368 remote_associated_interfaces_; |
1359 | 1369 |
1360 // TODO(dcheng): Remove these members. | 1370 // TODO(dcheng): Remove these members. |
1361 bool committed_first_load_ = false; | 1371 bool committed_first_load_ = false; |
1362 bool name_changed_before_first_commit_ = false; | 1372 bool name_changed_before_first_commit_ = false; |
1363 | 1373 |
1364 bool browser_side_navigation_pending_ = false; | 1374 bool browser_side_navigation_pending_ = false; |
1365 | 1375 |
| 1376 // A bitwise OR of bindings types that have been enabled for this RenderFrame. |
| 1377 // See BindingsPolicy for details. |
| 1378 int enabled_bindings_ = 0; |
| 1379 |
1366 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; | 1380 base::WeakPtrFactory<RenderFrameImpl> weak_factory_; |
1367 | 1381 |
1368 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); | 1382 DISALLOW_COPY_AND_ASSIGN(RenderFrameImpl); |
1369 }; | 1383 }; |
1370 | 1384 |
1371 } // namespace content | 1385 } // namespace content |
1372 | 1386 |
1373 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ | 1387 #endif // CONTENT_RENDERER_RENDER_FRAME_IMPL_H_ |
OLD | NEW |