| 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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 | 301 |
| 302 WebContents* WebContents::FromRenderFrameHost(RenderFrameHost* rfh) { | 302 WebContents* WebContents::FromRenderFrameHost(RenderFrameHost* rfh) { |
| 303 if (!rfh) | 303 if (!rfh) |
| 304 return nullptr; | 304 return nullptr; |
| 305 return static_cast<RenderFrameHostImpl*>(rfh)->delegate()->GetAsWebContents(); | 305 return static_cast<RenderFrameHostImpl*>(rfh)->delegate()->GetAsWebContents(); |
| 306 } | 306 } |
| 307 | 307 |
| 308 WebContents* WebContents::FromFrameTreeNodeId(int frame_tree_node_id) { | 308 WebContents* WebContents::FromFrameTreeNodeId(int frame_tree_node_id) { |
| 309 FrameTreeNode* frame_tree_node = | 309 FrameTreeNode* frame_tree_node = |
| 310 FrameTreeNode::GloballyFindByID(frame_tree_node_id); | 310 FrameTreeNode::GloballyFindByID(frame_tree_node_id); |
| 311 if (!frame_tree_node) |
| 312 return nullptr; |
| 311 return FromRenderFrameHost(frame_tree_node->current_frame_host()); | 313 return FromRenderFrameHost(frame_tree_node->current_frame_host()); |
| 312 } | 314 } |
| 313 | 315 |
| 314 // WebContentsImpl::DestructionObserver ---------------------------------------- | 316 // WebContentsImpl::DestructionObserver ---------------------------------------- |
| 315 | 317 |
| 316 class WebContentsImpl::DestructionObserver : public WebContentsObserver { | 318 class WebContentsImpl::DestructionObserver : public WebContentsObserver { |
| 317 public: | 319 public: |
| 318 DestructionObserver(WebContentsImpl* owner, WebContents* watched_contents) | 320 DestructionObserver(WebContentsImpl* owner, WebContents* watched_contents) |
| 319 : WebContentsObserver(watched_contents), | 321 : WebContentsObserver(watched_contents), |
| 320 owner_(owner) { | 322 owner_(owner) { |
| (...skipping 4944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5265 dialog_manager_ = dialog_manager; | 5267 dialog_manager_ = dialog_manager; |
| 5266 } | 5268 } |
| 5267 | 5269 |
| 5268 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) { | 5270 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) { |
| 5269 auto it = binding_sets_.find(interface_name); | 5271 auto it = binding_sets_.find(interface_name); |
| 5270 if (it != binding_sets_.end()) | 5272 if (it != binding_sets_.end()) |
| 5271 binding_sets_.erase(it); | 5273 binding_sets_.erase(it); |
| 5272 } | 5274 } |
| 5273 | 5275 |
| 5274 } // namespace content | 5276 } // namespace content |
| OLD | NEW |