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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 2465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2476 } | 2476 } |
2477 | 2477 |
2478 void WebContentsImpl::OnUpdateFaviconURL( | 2478 void WebContentsImpl::OnUpdateFaviconURL( |
2479 int32 page_id, | 2479 int32 page_id, |
2480 const std::vector<FaviconURL>& candidates) { | 2480 const std::vector<FaviconURL>& candidates) { |
2481 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 2481 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
2482 DidUpdateFaviconURL(page_id, candidates)); | 2482 DidUpdateFaviconURL(page_id, candidates)); |
2483 } | 2483 } |
2484 | 2484 |
2485 FrameTreeNode* WebContentsImpl::FindFrameTreeNodeByID(int64 frame_id) { | 2485 FrameTreeNode* WebContentsImpl::FindFrameTreeNodeByID(int64 frame_id) { |
| 2486 // TODO(nasko): Remove this check once we move to creating the root node |
| 2487 // through RenderFrameHost creation. |
| 2488 if (!frame_tree_root_.get()) |
| 2489 return NULL; |
| 2490 |
2486 FrameTreeNode* node = NULL; | 2491 FrameTreeNode* node = NULL; |
2487 std::queue<FrameTreeNode*> queue; | 2492 std::queue<FrameTreeNode*> queue; |
2488 queue.push(frame_tree_root_.get()); | 2493 queue.push(frame_tree_root_.get()); |
2489 | 2494 |
2490 while (!queue.empty()) { | 2495 while (!queue.empty()) { |
2491 node = queue.front(); | 2496 node = queue.front(); |
2492 queue.pop(); | 2497 queue.pop(); |
2493 if (node->frame_id() == frame_id) | 2498 if (node->frame_id() == frame_id) |
2494 return node; | 2499 return node; |
2495 | 2500 |
(...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3579 } | 3584 } |
3580 | 3585 |
3581 BrowserPluginGuestManager* | 3586 BrowserPluginGuestManager* |
3582 WebContentsImpl::GetBrowserPluginGuestManager() const { | 3587 WebContentsImpl::GetBrowserPluginGuestManager() const { |
3583 return static_cast<BrowserPluginGuestManager*>( | 3588 return static_cast<BrowserPluginGuestManager*>( |
3584 GetBrowserContext()->GetUserData( | 3589 GetBrowserContext()->GetUserData( |
3585 browser_plugin::kBrowserPluginGuestManagerKeyName)); | 3590 browser_plugin::kBrowserPluginGuestManagerKeyName)); |
3586 } | 3591 } |
3587 | 3592 |
3588 } // namespace content | 3593 } // namespace content |
OLD | NEW |