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

Unified Diff: chrome/browser/tab_contents/tab_util.cc

Issue 709933002: Add frameId to MessageSender (extension messaging API) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test: sender.tab.status = 'complete' Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/tab_contents/tab_util.h ('k') | chrome/renderer/extensions/extension_frame_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/tab_util.cc
diff --git a/chrome/browser/tab_contents/tab_util.cc b/chrome/browser/tab_contents/tab_util.cc
index 219a1a4cce8456664af32fc15ef247f45c4c93ae..e713ae3f58e38eded5624487b19cb046de26119a 100644
--- a/chrome/browser/tab_contents/tab_util.cc
+++ b/chrome/browser/tab_contents/tab_util.cc
@@ -7,6 +7,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h"
#include "chrome/common/chrome_switches.h"
+#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/site_instance.h"
#include "content/public/browser/web_contents.h"
@@ -16,6 +17,7 @@
#include "extensions/browser/extension_registry.h"
#endif
+using content::RenderFrameHost;
using content::RenderViewHost;
using content::SiteInstance;
using content::WebContents;
@@ -31,6 +33,15 @@ content::WebContents* GetWebContentsByID(int render_process_id,
return WebContents::FromRenderViewHost(render_view_host);
}
+content::WebContents* GetWebContentsByFrameID(int render_process_id,
+ int render_frame_id) {
+ RenderFrameHost* render_frame_host =
+ RenderFrameHost::FromID(render_process_id, render_frame_id);
+ if (!render_frame_host)
+ return NULL;
+ return WebContents::FromRenderFrameHost(render_frame_host);
+}
+
SiteInstance* GetSiteInstanceForNewTab(Profile* profile,
const GURL& url) {
// If |url| is a WebUI or extension, we set the SiteInstance up front so that
« no previous file with comments | « chrome/browser/tab_contents/tab_util.h ('k') | chrome/renderer/extensions/extension_frame_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698