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