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

Unified Diff: chrome/browser/ui/search_engines/search_engine_tab_helper.cc

Issue 917313004: Only accept HTTP and HTTPS urls for opensearch descriptor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix include Created 5 years, 10 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 | chrome/browser/ui/search_engines/search_engine_tab_helper_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/search_engines/search_engine_tab_helper.cc
diff --git a/chrome/browser/ui/search_engines/search_engine_tab_helper.cc b/chrome/browser/ui/search_engines/search_engine_tab_helper.cc
index fa6274dfeea784a27cbe4b27fbc9b94da258edd8..8d398d1a3d56f5400ab38182b01111905bf57b18 100644
--- a/chrome/browser/ui/search_engines/search_engine_tab_helper.cc
+++ b/chrome/browser/ui/search_engines/search_engine_tab_helper.cc
@@ -110,8 +110,12 @@ void SearchEngineTabHelper::OnPageHasOSDD(
// keyword.
// Make sure that the page is the current page and other basic checks.
- if (!osdd_url.is_valid())
+ // When |page_url| has file: scheme, this method doesn't work because of
+ // http://b/issue?id=863583. For that reason, this doesn't check and allow
+ // urls referring to osdd urls with same schemes.
+ if (!osdd_url.is_valid() || !osdd_url.SchemeIsHTTPOrHTTPS())
return;
+
Profile* profile =
Profile::FromBrowserContext(web_contents()->GetBrowserContext());
if (page_url != web_contents()->GetLastCommittedURL() ||
« no previous file with comments | « no previous file | chrome/browser/ui/search_engines/search_engine_tab_helper_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698