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

Unified Diff: content/shell/browser/shell.cc

Issue 176883012: Set the original url correctly if the frame is loaded via loadData (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase correctly Created 6 years, 8 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 | « content/shell/browser/shell.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/browser/shell.cc
diff --git a/content/shell/browser/shell.cc b/content/shell/browser/shell.cc
index b19ad1f313721f2fdc7c02259a96348ef1ca4110..027e6111c1c2463844caab85ecbfeee1dd2e541c 100644
--- a/content/shell/browser/shell.cc
+++ b/content/shell/browser/shell.cc
@@ -179,6 +179,18 @@ void Shell::LoadURLForFrame(const GURL& url, const std::string& frame_name) {
web_contents_->GetView()->Focus();
}
+void Shell::LoadDataWithBaseURL(const GURL& url, const std::string& data,
+ const GURL& base_url) {
+ const GURL data_url = GURL("data:text/html;charset=utf-8," + data);
+ NavigationController::LoadURLParams params(data_url);
+ params.load_type = NavigationController::LOAD_TYPE_DATA;
+ params.base_url_for_data_url = base_url;
+ params.virtual_url_for_data_url = url;
+ params.override_user_agent = NavigationController::UA_OVERRIDE_FALSE;
+ web_contents_->GetController().LoadURLWithParams(params);
+ web_contents_->GetView()->Focus();
+}
+
void Shell::AddNewContents(WebContents* source,
WebContents* new_contents,
WindowOpenDisposition disposition,
« no previous file with comments | « content/shell/browser/shell.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698