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

Unified Diff: content/browser/browser_plugin/browser_plugin_guest.cc

Issue 27408004: <webview>: Resolve relative paths as chrome-extension: URLs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactor + addressed creis' comments Created 7 years, 2 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
Index: content/browser/browser_plugin/browser_plugin_guest.cc
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc
index b8f7e24a2108263dbfb76888250361d4554783e8..a1853ef7294d944a1fe4146f64ec1b43d7e5782e 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.cc
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc
@@ -636,6 +636,7 @@ BrowserPluginGuest::~BrowserPluginGuest() {
// static
BrowserPluginGuest* BrowserPluginGuest::Create(
int instance_id,
+ SiteInstance* site_instance,
WebContentsImpl* web_contents,
scoped_ptr<base::DictionaryValue> extra_params) {
RecordAction(UserMetricsAction("BrowserPlugin.Guest.Create"));
@@ -649,7 +650,7 @@ BrowserPluginGuest* BrowserPluginGuest::Create(
web_contents->SetBrowserPluginGuest(guest);
BrowserPluginGuestDelegate* delegate = NULL;
GetContentClient()->browser()->GuestWebContentsCreated(
- web_contents, NULL, &delegate, extra_params.Pass());
+ site_instance, web_contents, NULL, &delegate, extra_params.Pass());
guest->SetDelegate(delegate);
return guest;
}
@@ -666,6 +667,7 @@ BrowserPluginGuest* BrowserPluginGuest::CreateWithOpener(
web_contents->SetBrowserPluginGuest(guest);
BrowserPluginGuestDelegate* delegate = NULL;
GetContentClient()->browser()->GuestWebContentsCreated(
+ opener->GetWebContents()->GetSiteInstance(),
web_contents, opener->GetWebContents(), &delegate,
scoped_ptr<base::DictionaryValue>());
guest->SetDelegate(delegate);
@@ -1339,7 +1341,7 @@ void BrowserPluginGuest::OnLockMouseAck(int instance_id, bool succeeded) {
void BrowserPluginGuest::OnNavigateGuest(
int instance_id,
const std::string& src) {
- GURL url(src);
+ GURL url = delegate_ ? delegate_->ResolveURL(src) : GURL(src);
// We do not load empty urls in web_contents.
// If a guest sets empty src attribute after it has navigated to some
// non-empty page, the action is considered no-op. This empty src navigation

Powered by Google App Engine
This is Rietveld 408576698