| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "content/browser/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 #include "content/browser/browser_plugin/browser_plugin_embedder.h" | 37 #include "content/browser/browser_plugin/browser_plugin_embedder.h" |
| 38 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 38 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
| 39 #include "content/browser/child_process_security_policy_impl.h" | 39 #include "content/browser/child_process_security_policy_impl.h" |
| 40 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" | 40 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" |
| 41 #include "content/browser/dom_storage/session_storage_namespace_impl.h" | 41 #include "content/browser/dom_storage/session_storage_namespace_impl.h" |
| 42 #include "content/browser/download/download_stats.h" | 42 #include "content/browser/download/download_stats.h" |
| 43 #include "content/browser/download/mhtml_generation_manager.h" | 43 #include "content/browser/download/mhtml_generation_manager.h" |
| 44 #include "content/browser/download/save_package.h" | 44 #include "content/browser/download/save_package.h" |
| 45 #include "content/browser/find_request_manager.h" | 45 #include "content/browser/find_request_manager.h" |
| 46 #include "content/browser/frame_host/cross_process_frame_connector.h" | 46 #include "content/browser/frame_host/cross_process_frame_connector.h" |
| 47 #include "content/browser/frame_host/frame_tree_node.h" |
| 47 #include "content/browser/frame_host/interstitial_page_impl.h" | 48 #include "content/browser/frame_host/interstitial_page_impl.h" |
| 48 #include "content/browser/frame_host/navigation_entry_impl.h" | 49 #include "content/browser/frame_host/navigation_entry_impl.h" |
| 49 #include "content/browser/frame_host/navigation_handle_impl.h" | 50 #include "content/browser/frame_host/navigation_handle_impl.h" |
| 50 #include "content/browser/frame_host/navigator_impl.h" | 51 #include "content/browser/frame_host/navigator_impl.h" |
| 51 #include "content/browser/frame_host/render_frame_host_impl.h" | 52 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 52 #include "content/browser/frame_host/render_frame_proxy_host.h" | 53 #include "content/browser/frame_host/render_frame_proxy_host.h" |
| 53 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" | 54 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" |
| 54 #include "content/browser/host_zoom_map_impl.h" | 55 #include "content/browser/host_zoom_map_impl.h" |
| 55 #include "content/browser/loader/loader_io_thread_notifier.h" | 56 #include "content/browser/loader/loader_io_thread_notifier.h" |
| 56 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 57 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 return nullptr; | 296 return nullptr; |
| 296 return rvh->GetDelegate()->GetAsWebContents(); | 297 return rvh->GetDelegate()->GetAsWebContents(); |
| 297 } | 298 } |
| 298 | 299 |
| 299 WebContents* WebContents::FromRenderFrameHost(RenderFrameHost* rfh) { | 300 WebContents* WebContents::FromRenderFrameHost(RenderFrameHost* rfh) { |
| 300 if (!rfh) | 301 if (!rfh) |
| 301 return nullptr; | 302 return nullptr; |
| 302 return static_cast<RenderFrameHostImpl*>(rfh)->delegate()->GetAsWebContents(); | 303 return static_cast<RenderFrameHostImpl*>(rfh)->delegate()->GetAsWebContents(); |
| 303 } | 304 } |
| 304 | 305 |
| 306 WebContents* WebContents::FromFrameTreeNodeId(int frame_tree_node_id) { |
| 307 FrameTreeNode* frame_tree_node = |
| 308 FrameTreeNode::GloballyFindByID(frame_tree_node_id); |
| 309 return FromRenderFrameHost(frame_tree_node->current_frame_host()); |
| 310 } |
| 311 |
| 305 // WebContentsImpl::DestructionObserver ---------------------------------------- | 312 // WebContentsImpl::DestructionObserver ---------------------------------------- |
| 306 | 313 |
| 307 class WebContentsImpl::DestructionObserver : public WebContentsObserver { | 314 class WebContentsImpl::DestructionObserver : public WebContentsObserver { |
| 308 public: | 315 public: |
| 309 DestructionObserver(WebContentsImpl* owner, WebContents* watched_contents) | 316 DestructionObserver(WebContentsImpl* owner, WebContents* watched_contents) |
| 310 : WebContentsObserver(watched_contents), | 317 : WebContentsObserver(watched_contents), |
| 311 owner_(owner) { | 318 owner_(owner) { |
| 312 } | 319 } |
| 313 | 320 |
| 314 // WebContentsObserver: | 321 // WebContentsObserver: |
| (...skipping 4929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5244 dialog_manager_ = dialog_manager; | 5251 dialog_manager_ = dialog_manager; |
| 5245 } | 5252 } |
| 5246 | 5253 |
| 5247 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) { | 5254 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) { |
| 5248 auto it = binding_sets_.find(interface_name); | 5255 auto it = binding_sets_.find(interface_name); |
| 5249 if (it != binding_sets_.end()) | 5256 if (it != binding_sets_.end()) |
| 5250 binding_sets_.erase(it); | 5257 binding_sets_.erase(it); |
| 5251 } | 5258 } |
| 5252 | 5259 |
| 5253 } // namespace content | 5260 } // namespace content |
| OLD | NEW |