| 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/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 760 return frame_tree_.root()->current_frame_host(); | 760 return frame_tree_.root()->current_frame_host(); |
| 761 } | 761 } |
| 762 | 762 |
| 763 RenderFrameHostImpl* WebContentsImpl::GetFocusedFrame() { | 763 RenderFrameHostImpl* WebContentsImpl::GetFocusedFrame() { |
| 764 FrameTreeNode* focused_node = frame_tree_.GetFocusedFrame(); | 764 FrameTreeNode* focused_node = frame_tree_.GetFocusedFrame(); |
| 765 if (!focused_node) | 765 if (!focused_node) |
| 766 return nullptr; | 766 return nullptr; |
| 767 return focused_node->current_frame_host(); | 767 return focused_node->current_frame_host(); |
| 768 } | 768 } |
| 769 | 769 |
| 770 RenderFrameHostImpl* WebContentsImpl::FindFrameByFrameTreeNodeId( |
| 771 int frame_tree_node_id) { |
| 772 FrameTreeNode* frame = frame_tree_.FindByID(frame_tree_node_id); |
| 773 return frame ? frame->current_frame_host() : nullptr; |
| 774 } |
| 775 |
| 770 void WebContentsImpl::ForEachFrame( | 776 void WebContentsImpl::ForEachFrame( |
| 771 const base::Callback<void(RenderFrameHost*)>& on_frame) { | 777 const base::Callback<void(RenderFrameHost*)>& on_frame) { |
| 772 frame_tree_.ForEach(base::Bind(&ForEachFrameInternal, on_frame)); | 778 frame_tree_.ForEach(base::Bind(&ForEachFrameInternal, on_frame)); |
| 773 } | 779 } |
| 774 | 780 |
| 775 void WebContentsImpl::SendToAllFrames(IPC::Message* message) { | 781 void WebContentsImpl::SendToAllFrames(IPC::Message* message) { |
| 776 ForEachFrame(base::Bind(&SendToAllFramesInternal, message)); | 782 ForEachFrame(base::Bind(&SendToAllFramesInternal, message)); |
| 777 delete message; | 783 delete message; |
| 778 } | 784 } |
| 779 | 785 |
| (...skipping 3935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4715 const WebContentsObserver::MediaPlayerId& id) { | 4721 const WebContentsObserver::MediaPlayerId& id) { |
| 4716 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying(id)); | 4722 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying(id)); |
| 4717 } | 4723 } |
| 4718 | 4724 |
| 4719 void WebContentsImpl::MediaStoppedPlaying( | 4725 void WebContentsImpl::MediaStoppedPlaying( |
| 4720 const WebContentsObserver::MediaPlayerId& id) { | 4726 const WebContentsObserver::MediaPlayerId& id) { |
| 4721 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id)); | 4727 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id)); |
| 4722 } | 4728 } |
| 4723 | 4729 |
| 4724 } // namespace content | 4730 } // namespace content |
| OLD | NEW |