Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(394)

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 1413543005: Use FrameTreeNode ID as frameId in extension APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: s/:/ / Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <utility> 9 #include <utility>
10 10
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after
764 return frame_tree_.root()->current_frame_host(); 764 return frame_tree_.root()->current_frame_host();
765 } 765 }
766 766
767 RenderFrameHostImpl* WebContentsImpl::GetFocusedFrame() { 767 RenderFrameHostImpl* WebContentsImpl::GetFocusedFrame() {
768 FrameTreeNode* focused_node = frame_tree_.GetFocusedFrame(); 768 FrameTreeNode* focused_node = frame_tree_.GetFocusedFrame();
769 if (!focused_node) 769 if (!focused_node)
770 return nullptr; 770 return nullptr;
771 return focused_node->current_frame_host(); 771 return focused_node->current_frame_host();
772 } 772 }
773 773
774 RenderFrameHostImpl* WebContentsImpl::FindFrameByFrameTreeNodeId(
775 int frame_tree_node_id) {
776 FrameTreeNode* frame = frame_tree_.FindByID(frame_tree_node_id);
777 return frame ? frame->current_frame_host() : nullptr;
778 }
779
774 void WebContentsImpl::ForEachFrame( 780 void WebContentsImpl::ForEachFrame(
775 const base::Callback<void(RenderFrameHost*)>& on_frame) { 781 const base::Callback<void(RenderFrameHost*)>& on_frame) {
776 frame_tree_.ForEach(base::Bind(&ForEachFrameInternal, on_frame)); 782 frame_tree_.ForEach(base::Bind(&ForEachFrameInternal, on_frame));
777 } 783 }
778 784
779 void WebContentsImpl::SendToAllFrames(IPC::Message* message) { 785 void WebContentsImpl::SendToAllFrames(IPC::Message* message) {
780 ForEachFrame(base::Bind(&SendToAllFramesInternal, message)); 786 ForEachFrame(base::Bind(&SendToAllFramesInternal, message));
781 delete message; 787 delete message;
782 } 788 }
783 789
(...skipping 3937 matching lines...) Expand 10 before | Expand all | Expand 10 after
4721 const WebContentsObserver::MediaPlayerId& id) { 4727 const WebContentsObserver::MediaPlayerId& id) {
4722 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying(id)); 4728 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStartedPlaying(id));
4723 } 4729 }
4724 4730
4725 void WebContentsImpl::MediaStoppedPlaying( 4731 void WebContentsImpl::MediaStoppedPlaying(
4726 const WebContentsObserver::MediaPlayerId& id) { 4732 const WebContentsObserver::MediaPlayerId& id) {
4727 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id)); 4733 FOR_EACH_OBSERVER(WebContentsObserver, observers_, MediaStoppedPlaying(id));
4728 } 4734 }
4729 4735
4730 } // namespace content 4736 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698