| 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/bad_message.h" |
| 18 #include "content/browser/site_instance_impl.h" | 19 #include "content/browser/site_instance_impl.h" |
| 19 #include "content/common/accessibility_mode_enums.h" | 20 #include "content/common/accessibility_mode_enums.h" |
| 20 #include "content/common/ax_content_node_data.h" | 21 #include "content/common/ax_content_node_data.h" |
| 21 #include "content/common/content_export.h" | 22 #include "content/common/content_export.h" |
| 22 #include "content/common/frame_message_enums.h" | 23 #include "content/common/frame_message_enums.h" |
| 23 #include "content/common/frame_replication_state.h" | 24 #include "content/common/frame_replication_state.h" |
| 24 #include "content/common/image_downloader/image_downloader.mojom.h" | 25 #include "content/common/image_downloader/image_downloader.mojom.h" |
| 25 #include "content/common/mojo/service_registry_impl.h" | 26 #include "content/common/mojo/service_registry_impl.h" |
| 26 #include "content/common/navigation_params.h" | 27 #include "content/common/navigation_params.h" |
| 27 #include "content/public/browser/render_frame_host.h" | 28 #include "content/public/browser/render_frame_host.h" |
| 28 #include "content/public/common/javascript_message_type.h" | 29 #include "content/public/common/javascript_message_type.h" |
| 29 #include "net/http/http_response_headers.h" | 30 #include "net/http/http_response_headers.h" |
| 31 #include "third_party/WebKit/public/web/WebFrameOwnerProperties.h" |
| 30 #include "third_party/WebKit/public/web/WebTextDirection.h" | 32 #include "third_party/WebKit/public/web/WebTextDirection.h" |
| 31 #include "third_party/WebKit/public/web/WebTreeScopeType.h" | 33 #include "third_party/WebKit/public/web/WebTreeScopeType.h" |
| 32 #include "ui/accessibility/ax_node_data.h" | 34 #include "ui/accessibility/ax_node_data.h" |
| 33 #include "ui/base/page_transition_types.h" | 35 #include "ui/base/page_transition_types.h" |
| 34 | 36 |
| 35 #if defined(OS_ANDROID) | 37 #if defined(OS_ANDROID) |
| 36 #include "content/browser/mojo/service_registry_android.h" | 38 #include "content/browser/mojo/service_registry_android.h" |
| 37 #endif | 39 #endif |
| 38 | 40 |
| 39 class GURL; | 41 class GURL; |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 // Tracks whether the RenderFrame for this RenderFrameHost has been created in | 199 // Tracks whether the RenderFrame for this RenderFrameHost has been created in |
| 198 // the renderer process. This is currently only used for subframes. | 200 // the renderer process. This is currently only used for subframes. |
| 199 // TODO(creis): Use this for main frames as well when RVH goes away. | 201 // TODO(creis): Use this for main frames as well when RVH goes away. |
| 200 void SetRenderFrameCreated(bool created); | 202 void SetRenderFrameCreated(bool created); |
| 201 | 203 |
| 202 // Called for renderer-created windows to resume requests from this frame, | 204 // Called for renderer-created windows to resume requests from this frame, |
| 203 // after they are blocked in RenderWidgetHelper::CreateNewWindow. | 205 // after they are blocked in RenderWidgetHelper::CreateNewWindow. |
| 204 void Init(); | 206 void Init(); |
| 205 | 207 |
| 206 int routing_id() const { return routing_id_; } | 208 int routing_id() const { return routing_id_; } |
| 207 void OnCreateChildFrame(int new_routing_id, | 209 void OnCreateChildFrame( |
| 208 blink::WebTreeScopeType scope, | 210 int new_routing_id, |
| 209 const std::string& frame_name, | 211 blink::WebTreeScopeType scope, |
| 210 blink::WebSandboxFlags sandbox_flags); | 212 const std::string& frame_name, |
| 213 blink::WebSandboxFlags sandbox_flags, |
| 214 const blink::WebFrameOwnerProperties& frame_owner_properties); |
| 211 | 215 |
| 212 RenderViewHostImpl* render_view_host() { return render_view_host_; } | 216 RenderViewHostImpl* render_view_host() { return render_view_host_; } |
| 213 RenderFrameHostDelegate* delegate() { return delegate_; } | 217 RenderFrameHostDelegate* delegate() { return delegate_; } |
| 214 FrameTreeNode* frame_tree_node() { return frame_tree_node_; } | 218 FrameTreeNode* frame_tree_node() { return frame_tree_node_; } |
| 215 | 219 |
| 216 // Returns this RenderFrameHost's loading state. This method is only used by | 220 // Returns this RenderFrameHost's loading state. This method is only used by |
| 217 // FrameTreeNode. The proper way to check whether a frame is loading is to | 221 // FrameTreeNode. The proper way to check whether a frame is loading is to |
| 218 // call FrameTreeNode::IsLoading. | 222 // call FrameTreeNode::IsLoading. |
| 219 bool is_loading() const { return is_loading_; } | 223 bool is_loading() const { return is_loading_; } |
| 220 | 224 |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 IPC::Message* reply_msg); | 539 IPC::Message* reply_msg); |
| 536 void OnTextSurroundingSelectionResponse(const base::string16& content, | 540 void OnTextSurroundingSelectionResponse(const base::string16& content, |
| 537 size_t start_offset, | 541 size_t start_offset, |
| 538 size_t end_offset); | 542 size_t end_offset); |
| 539 void OnDidAccessInitialDocument(); | 543 void OnDidAccessInitialDocument(); |
| 540 void OnDidChangeOpener(int32 opener_routing_id); | 544 void OnDidChangeOpener(int32 opener_routing_id); |
| 541 void OnDidChangeName(const std::string& name); | 545 void OnDidChangeName(const std::string& name); |
| 542 void OnDidAssignPageId(int32 page_id); | 546 void OnDidAssignPageId(int32 page_id); |
| 543 void OnDidChangeSandboxFlags(int32 frame_routing_id, | 547 void OnDidChangeSandboxFlags(int32 frame_routing_id, |
| 544 blink::WebSandboxFlags flags); | 548 blink::WebSandboxFlags flags); |
| 549 void OnDidChangeFrameOwnerProperties( |
| 550 int32 frame_routing_id, |
| 551 const blink::WebFrameOwnerProperties& frame_owner_properties); |
| 545 void OnUpdateTitle(const base::string16& title, | 552 void OnUpdateTitle(const base::string16& title, |
| 546 blink::WebTextDirection title_direction); | 553 blink::WebTextDirection title_direction); |
| 547 void OnUpdateEncoding(const std::string& encoding); | 554 void OnUpdateEncoding(const std::string& encoding); |
| 548 void OnBeginNavigation(const CommonNavigationParams& common_params, | 555 void OnBeginNavigation(const CommonNavigationParams& common_params, |
| 549 const BeginNavigationParams& begin_params, | 556 const BeginNavigationParams& begin_params, |
| 550 scoped_refptr<ResourceRequestBody> body); | 557 scoped_refptr<ResourceRequestBody> body); |
| 551 void OnDispatchLoad(); | 558 void OnDispatchLoad(); |
| 552 void OnAccessibilityEvents( | 559 void OnAccessibilityEvents( |
| 553 const std::vector<AccessibilityHostMsg_EventParams>& params, | 560 const std::vector<AccessibilityHostMsg_EventParams>& params, |
| 554 int reset_token); | 561 int reset_token); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 615 RenderWidgetHostViewBase* GetViewForAccessibility(); | 622 RenderWidgetHostViewBase* GetViewForAccessibility(); |
| 616 | 623 |
| 617 // Sends a navigate message to the RenderFrame and notifies DevTools about | 624 // Sends a navigate message to the RenderFrame and notifies DevTools about |
| 618 // navigation happening. Should be used instead of sending the message | 625 // navigation happening. Should be used instead of sending the message |
| 619 // directly. | 626 // directly. |
| 620 void SendNavigateMessage( | 627 void SendNavigateMessage( |
| 621 const content::CommonNavigationParams& common_params, | 628 const content::CommonNavigationParams& common_params, |
| 622 const content::StartNavigationParams& start_params, | 629 const content::StartNavigationParams& start_params, |
| 623 const content::RequestNavigationParams& request_params); | 630 const content::RequestNavigationParams& request_params); |
| 624 | 631 |
| 632 // Returns the child FrameTreeNode if |child_frame_routing_id| is an |
| 633 // immediate child of this FrameTreeNode. Kills this renderer otherwise |
| 634 // with bad message |reason|. |
| 635 FrameTreeNode* CheckAndGetIfImmediateChild( |
| 636 int32 child_frame_routing_id, bad_message::BadMessageReason reason); |
| 637 |
| 625 // For now, RenderFrameHosts indirectly keep RenderViewHosts alive via a | 638 // For now, RenderFrameHosts indirectly keep RenderViewHosts alive via a |
| 626 // refcount that calls Shutdown when it reaches zero. This allows each | 639 // refcount that calls Shutdown when it reaches zero. This allows each |
| 627 // RenderFrameHostManager to just care about RenderFrameHosts, while ensuring | 640 // RenderFrameHostManager to just care about RenderFrameHosts, while ensuring |
| 628 // we have a RenderViewHost for each RenderFrameHost. | 641 // we have a RenderViewHost for each RenderFrameHost. |
| 629 // TODO(creis): RenderViewHost will eventually go away and be replaced with | 642 // TODO(creis): RenderViewHost will eventually go away and be replaced with |
| 630 // some form of page context. | 643 // some form of page context. |
| 631 RenderViewHostImpl* render_view_host_; | 644 RenderViewHostImpl* render_view_host_; |
| 632 | 645 |
| 633 RenderFrameHostDelegate* delegate_; | 646 RenderFrameHostDelegate* delegate_; |
| 634 | 647 |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 792 | 805 |
| 793 // NOTE: This must be the last member. | 806 // NOTE: This must be the last member. |
| 794 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; | 807 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; |
| 795 | 808 |
| 796 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); | 809 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); |
| 797 }; | 810 }; |
| 798 | 811 |
| 799 } // namespace content | 812 } // namespace content |
| 800 | 813 |
| 801 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ | 814 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
| OLD | NEW |