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

Unified Diff: chrome/browser/ui/webui/print_preview/print_preview_handler.cc

Issue 2056203002: Remove credentials from URL in printed page footer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/print_preview/print_preview_handler.cc
diff --git a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
index 77b33c45d10995a4c7a00b2b1242fc14fa68ebe0..5cf423f50c95139ec977ade3f439d1a794881b35 100644
--- a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
+++ b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
@@ -814,8 +814,13 @@ void PrintPreviewHandler::HandleGetPreview(const base::ListValue* args) {
std::string url;
content::NavigationEntry* entry =
initiator->GetController().GetLastCommittedEntry();
- if (entry)
- url = entry->GetVirtualURL().spec();
+ if (entry) {
+ url::Replacements<char> url_sanitizer;
+ url_sanitizer.ClearUsername();
+ url_sanitizer.ClearPassword();
+
+ url = entry->GetVirtualURL().ReplaceComponents(url_sanitizer).spec();
+ }
settings->SetString(printing::kSettingHeaderFooterURL, url);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698