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

Unified Diff: chrome/browser/search/iframe_source.cc

Issue 102433009: Most visited iframe now postMessage to signal the iframing page that the link has been displayed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/search/iframe_source.h ('k') | chrome/browser/search/iframe_source_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/search/iframe_source.cc
diff --git a/chrome/browser/search/iframe_source.cc b/chrome/browser/search/iframe_source.cc
index 16d6c416ca5cd43b10b777e6b858f2a5f8885df8..285638569c19235779699764060f9e692651060d 100644
--- a/chrome/browser/search/iframe_source.cc
+++ b/chrome/browser/search/iframe_source.cc
@@ -9,7 +9,8 @@
#include "base/strings/string_util.h"
#include "chrome/browser/search/instant_io_context.h"
#include "chrome/common/url_constants.h"
-#include "content/public/browser/render_view_host.h"
+#include "content/public/browser/navigation_entry.h"
+#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents.h"
#include "grit/browser_resources.h"
#include "net/url_request/url_request.h"
@@ -51,17 +52,22 @@ bool IframeSource::ShouldDenyXFrameOptions() const {
bool IframeSource::GetOrigin(
int render_process_id,
- int render_view_id,
+ int render_frame_id,
std::string* origin) const {
- content::RenderViewHost* rvh =
- content::RenderViewHost::FromID(render_process_id, render_view_id);
- if (rvh == NULL)
+ content::RenderFrameHost* rfh =
+ content::RenderFrameHost::FromID(render_process_id, render_frame_id);
+ if (rfh == NULL)
return false;
content::WebContents* contents =
- content::WebContents::FromRenderViewHost(rvh);
+ content::WebContents::FromRenderFrameHost(rfh);
if (contents == NULL)
return false;
- *origin = contents->GetURL().GetOrigin().spec();
+ const content::NavigationEntry* entry =
+ contents->GetController().GetVisibleEntry();
+ if (entry == NULL)
+ return false;
+
+ *origin = entry->GetURL().GetOrigin().spec();
// Origin should not include a trailing slash. That is part of the path.
base::TrimString(*origin, "/", origin);
return true;
@@ -78,10 +84,10 @@ void IframeSource::SendResource(
void IframeSource::SendJSWithOrigin(
int resource_id,
int render_process_id,
- int render_view_id,
+ int render_frame_id,
const content::URLDataSource::GotDataCallback& callback) {
std::string origin;
- if (!GetOrigin(render_process_id, render_view_id, &origin)) {
+ if (!GetOrigin(render_process_id, render_frame_id, &origin)) {
callback.Run(NULL);
return;
}
« no previous file with comments | « chrome/browser/search/iframe_source.h ('k') | chrome/browser/search/iframe_source_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698