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

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: Don't update src attribute with resolved URL. 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 5a55c7357d1afcfd91065c5ea69dd793f94e001a..58ebbfbaf404a492ccde77f9c1e361de8733984e 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.cc
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc
@@ -365,6 +365,18 @@ BrowserPluginGuest::BrowserPluginGuest(
GetWebContents());
}
+SiteInstance* BrowserPluginGuest::GetEmbedderSiteInstance() const {
+ if (attached())
+ return embedder_web_contents()->GetSiteInstance();
+
+ if (!opener()) {
Charlie Reis 2013/10/18 17:37:55 How do we know this is true? Couldn't we have an
Fady Samuel 2013/10/25 21:10:31 I've removed this method. It's no longer necessary
+ NOTREACHED();
+ return NULL;
+ }
+
+ return opener()->embedder_web_contents()->GetSiteInstance();
Charlie Reis 2013/10/18 17:37:55 This seems confusing to me. There's no guarantee
Fady Samuel 2013/10/25 21:10:31 Removed.
+}
+
bool BrowserPluginGuest::AddMessageToConsole(WebContents* source,
int32 level,
const string16& message,
@@ -1342,7 +1354,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