| 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_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
| 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
| 16 #include "base/time/time.h" | 16 #include "base/time/time.h" |
| 17 #include "content/browser/accessibility/browser_accessibility_manager.h" | 17 #include "content/browser/accessibility/browser_accessibility_manager.h" |
| 18 #include "content/browser/site_instance_impl.h" | 18 #include "content/browser/site_instance_impl.h" |
| 19 #include "content/common/accessibility_mode_enums.h" | 19 #include "content/common/accessibility_mode_enums.h" |
| 20 #include "content/common/content_export.h" | 20 #include "content/common/content_export.h" |
| 21 #include "content/common/mojo/service_registry_impl.h" | 21 #include "content/common/mojo/service_registry_impl.h" |
| 22 #include "content/common/render_frame_setup.mojom.h" |
| 22 #include "content/public/browser/render_frame_host.h" | 23 #include "content/public/browser/render_frame_host.h" |
| 23 #include "content/public/common/javascript_message_type.h" | 24 #include "content/public/common/javascript_message_type.h" |
| 24 #include "net/http/http_response_headers.h" | 25 #include "net/http/http_response_headers.h" |
| 25 #include "third_party/WebKit/public/platform/WebNotificationPermission.h" | 26 #include "third_party/WebKit/public/platform/WebNotificationPermission.h" |
| 26 #include "third_party/WebKit/public/web/WebTextDirection.h" | 27 #include "third_party/WebKit/public/web/WebTextDirection.h" |
| 27 #include "ui/accessibility/ax_node_data.h" | 28 #include "ui/accessibility/ax_node_data.h" |
| 28 #include "ui/base/page_transition_types.h" | 29 #include "ui/base/page_transition_types.h" |
| 29 | 30 |
| 30 #if defined(OS_ANDROID) | 31 #if defined(OS_ANDROID) |
| 31 #include "content/browser/mojo/service_registry_android.h" | 32 #include "content/browser/mojo/service_registry_android.h" |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 void OnAccessibilityEvents( | 429 void OnAccessibilityEvents( |
| 429 const std::vector<AccessibilityHostMsg_EventParams>& params); | 430 const std::vector<AccessibilityHostMsg_EventParams>& params); |
| 430 void OnAccessibilityLocationChanges( | 431 void OnAccessibilityLocationChanges( |
| 431 const std::vector<AccessibilityHostMsg_LocationChangeParams>& params); | 432 const std::vector<AccessibilityHostMsg_LocationChangeParams>& params); |
| 432 | 433 |
| 433 #if defined(OS_MACOSX) || defined(OS_ANDROID) | 434 #if defined(OS_MACOSX) || defined(OS_ANDROID) |
| 434 void OnShowPopup(const FrameHostMsg_ShowPopup_Params& params); | 435 void OnShowPopup(const FrameHostMsg_ShowPopup_Params& params); |
| 435 void OnHidePopup(); | 436 void OnHidePopup(); |
| 436 #endif | 437 #endif |
| 437 | 438 |
| 439 // Registers Mojo services that this frame host makes available. |
| 440 void RegisterMojoServices(); |
| 441 |
| 438 // Updates the state of this RenderFrameHost and clears any waiting state | 442 // Updates the state of this RenderFrameHost and clears any waiting state |
| 439 // that is no longer relevant. | 443 // that is no longer relevant. |
| 440 void SetState(RenderFrameHostImplState rfh_state); | 444 void SetState(RenderFrameHostImplState rfh_state); |
| 441 | 445 |
| 442 // Returns whether the given URL is allowed to commit in the current process. | 446 // Returns whether the given URL is allowed to commit in the current process. |
| 443 // This is a more conservative check than RenderProcessHost::FilterURL, since | 447 // This is a more conservative check than RenderProcessHost::FilterURL, since |
| 444 // it will be used to kill processes that commit unauthorized URLs. | 448 // it will be used to kill processes that commit unauthorized URLs. |
| 445 bool CanCommitURL(const GURL& url); | 449 bool CanCommitURL(const GURL& url); |
| 446 | 450 |
| 447 void PlatformNotificationPermissionRequestDone( | 451 void PlatformNotificationPermissionRequestDone( |
| 448 int request_id, blink::WebNotificationPermission permission); | 452 int request_id, blink::WebNotificationPermission permission); |
| 449 | 453 |
| 450 // Update the the singleton FrameAccessibility instance with a map | 454 // Update the the singleton FrameAccessibility instance with a map |
| 451 // from accessibility node id to the frame routing id of a cross-process | 455 // from accessibility node id to the frame routing id of a cross-process |
| 452 // iframe. | 456 // iframe. |
| 453 void UpdateCrossProcessIframeAccessibility( | 457 void UpdateCrossProcessIframeAccessibility( |
| 454 const std::map<int32, int> node_to_frame_routing_id_map); | 458 const std::map<int32, int> node_to_frame_routing_id_map); |
| 455 | 459 |
| 456 // Update the the singleton FrameAccessibility instance with a map | 460 // Update the the singleton FrameAccessibility instance with a map |
| 457 // from accessibility node id to the browser plugin instance id of a | 461 // from accessibility node id to the browser plugin instance id of a |
| 458 // guest WebContents. | 462 // guest WebContents. |
| 459 void UpdateGuestFrameAccessibility( | 463 void UpdateGuestFrameAccessibility( |
| 460 const std::map<int32, int> node_to_browser_plugin_instance_id_map); | 464 const std::map<int32, int> node_to_browser_plugin_instance_id_map); |
| 461 | 465 |
| 466 // Informs the content client that geolocation permissions were used. |
| 467 void DidUseGeolocationPermission(); |
| 468 |
| 462 // For now, RenderFrameHosts indirectly keep RenderViewHosts alive via a | 469 // For now, RenderFrameHosts indirectly keep RenderViewHosts alive via a |
| 463 // refcount that calls Shutdown when it reaches zero. This allows each | 470 // refcount that calls Shutdown when it reaches zero. This allows each |
| 464 // RenderFrameHostManager to just care about RenderFrameHosts, while ensuring | 471 // RenderFrameHostManager to just care about RenderFrameHosts, while ensuring |
| 465 // we have a RenderViewHost for each RenderFrameHost. | 472 // we have a RenderViewHost for each RenderFrameHost. |
| 466 // TODO(creis): RenderViewHost will eventually go away and be replaced with | 473 // TODO(creis): RenderViewHost will eventually go away and be replaced with |
| 467 // some form of page context. | 474 // some form of page context. |
| 468 RenderViewHostImpl* render_view_host_; | 475 RenderViewHostImpl* render_view_host_; |
| 469 | 476 |
| 470 RenderFrameHostDelegate* delegate_; | 477 RenderFrameHostDelegate* delegate_; |
| 471 | 478 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 | 565 |
| 559 // Callback when an event is received, for testing. | 566 // Callback when an event is received, for testing. |
| 560 base::Callback<void(ui::AXEvent, int)> accessibility_testing_callback_; | 567 base::Callback<void(ui::AXEvent, int)> accessibility_testing_callback_; |
| 561 // The most recently received accessibility tree - for testing only. | 568 // The most recently received accessibility tree - for testing only. |
| 562 scoped_ptr<ui::AXTree> ax_tree_for_testing_; | 569 scoped_ptr<ui::AXTree> ax_tree_for_testing_; |
| 563 | 570 |
| 564 // PlzNavigate: Owns the stream used in navigations to store the body of the | 571 // PlzNavigate: Owns the stream used in navigations to store the body of the |
| 565 // response once it has started. | 572 // response once it has started. |
| 566 scoped_ptr<StreamHandle> stream_handle_; | 573 scoped_ptr<StreamHandle> stream_handle_; |
| 567 | 574 |
| 575 // Holds the browser-side handle to the pipe used to establish the Mojo |
| 576 // connection between this instance and its associated render frame. |
| 577 RenderFrameSetupPtr render_frame_setup_; |
| 578 |
| 568 // NOTE: This must be the last member. | 579 // NOTE: This must be the last member. |
| 569 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; | 580 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; |
| 570 | 581 |
| 571 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); | 582 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); |
| 572 }; | 583 }; |
| 573 | 584 |
| 574 } // namespace content | 585 } // namespace content |
| 575 | 586 |
| 576 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ | 587 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
| OLD | NEW |