Commit c2fc6144 authored by fsamuel's avatar fsamuel Committed by Commit bot

<webview>: Removed ResolveURL

ResolveURL was more complex than it needed to be and it only worked for extensions.

This CL moves that funcitonality to NavigateGuest, and expands its scope to WebUI.

BUG=none

Review URL: https://codereview.chromium.org/964463004

Cr-Commit-Position: refs/heads/master@{#318281}
parent 60f51ca8
......@@ -880,9 +880,10 @@ void WebViewGuest::NavigateGuest(const std::string& src,
if (src.empty())
return;
GURL url = ResolveURL(src);
LoadURLWithParams(url, content::Referrer(),
// Resolve the |src| relative to the base URL of the owner.
GURL owner_base_url(GetOwnerSiteURL().GetWithEmptyPath());
LoadURLWithParams(owner_base_url.Resolve(src),
content::Referrer(),
ui::PAGE_TRANSITION_AUTO_TOPLEVEL,
force_navigation);
}
......@@ -1251,16 +1252,6 @@ void WebViewGuest::RequestNewWindowPermission(
false /* allowed_by_default */);
}
GURL WebViewGuest::ResolveURL(const std::string& src) {
if (!in_extension())
return GURL(src);
GURL default_url(base::StringPrintf("%s://%s/",
kExtensionScheme,
owner_extension_id().c_str()));
return default_url.Resolve(src);
}
void WebViewGuest::OnWebViewNewWindowResponse(
int new_window_instance_id,
bool allow,
......
......@@ -299,9 +299,6 @@ class WebViewGuest : public GuestView<WebViewGuest>,
bool user_gesture,
content::WebContents* new_contents);
// Requests resolution of a potentially relative URL.
GURL ResolveURL(const std::string& src);
// Notification that a load in the guest resulted in abort. Note that |url|
// may be invalid.
void LoadAbort(bool is_top_level,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment