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 4951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5272 dialog_manager_ = dialog_manager; | 5274 dialog_manager_ = dialog_manager; |
5273 } | 5275 } |
5274 | 5276 |
5275 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) { | 5277 void WebContentsImpl::RemoveBindingSet(const std::string& interface_name) { |
5276 auto it = binding_sets_.find(interface_name); | 5278 auto it = binding_sets_.find(interface_name); |
5277 if (it != binding_sets_.end()) | 5279 if (it != binding_sets_.end()) |
5278 binding_sets_.erase(it); | 5280 binding_sets_.erase(it); |
5279 } | 5281 } |
5280 | 5282 |
5281 } // namespace content | 5283 } // namespace content |
OLD | NEW |