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

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

Issue 9808029: Prepending view-source: does not load the source of the userscript. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Removed comments. Created 8 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/browser/tab_contents/tab_contents.cc
diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc
index 9f783d0b931986641db42717f577078d2a274ccb..6566c268eef8bcb6e871f27a778e9dc727927b65 100644
--- a/content/browser/tab_contents/tab_contents.cc
+++ b/content/browser/tab_contents/tab_contents.cc
@@ -200,6 +200,9 @@ void MakeNavigateParams(const NavigationEntryImpl& entry,
params->current_history_list_offset = controller.GetLastCommittedEntryIndex();
params->current_history_list_length = controller.GetEntryCount();
params->url = entry.GetURL();
+ // We only want to allow downloading if "view-source:" is not pre-pended.
+ params->allow_download =
+ !entry.GetVirtualURL().SchemeIs(chrome::kViewSourceScheme);
params->referrer = entry.GetReferrer();
params->transition = entry.GetTransitionType();
params->state = entry.GetContentState();

Powered by Google App Engine
This is Rietveld 408576698