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

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: add // static comment Created 6 years, 9 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/shell/browser/shell.cc
diff --git a/content/shell/browser/shell.cc b/content/shell/browser/shell.cc
index 65491237ab7dea5c96a6478c50c9bb432274e85f..060c512354ee30dcb5add257e3d4df7a069cd865 100644
--- a/content/shell/browser/shell.cc
+++ b/content/shell/browser/shell.cc
@@ -179,6 +179,17 @@ void Shell::LoadURLForFrame(const GURL& url, const std::string& frame_name) {
web_contents_->GetView()->Focus();
}
+void Shell::LoadDataWithBaseURL(const GURL& base_url, const std::string& data,
darin (slow to review) 2014/03/27 08:10:28 nit: since this method is named LoadDataWithBaseUR
hush (inactive) 2014/03/27 20:15:00 Done.
+ const GURL& history_url) {
+ const GURL url = GURL("data:text/html;charset=utf-8," + data);
+ NavigationController::LoadURLParams params(url);
+ params.load_type = NavigationController::LOAD_TYPE_DATA;
+ params.base_url_for_data_url = base_url;
+ params.virtual_url_for_data_url = history_url;
+ params.override_user_agent = NavigationController::UA_OVERRIDE_FALSE;
+ web_contents_->GetController().LoadURLWithParams(params);
+ web_contents_->GetView()->Focus();
+}
darin (slow to review) 2014/03/27 08:10:28 nit: add a new line below here.
hush (inactive) 2014/03/27 20:15:00 Done.
void Shell::AddNewContents(WebContents* source,
WebContents* new_contents,
WindowOpenDisposition disposition,

Powered by Google App Engine
This is Rietveld 408576698