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

Unified Diff: chrome/renderer/searchbox/searchbox_extension.cc

Issue 1669723002: NTP: don't allow navigateContentWindow to navigate where it pleases. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Better comments Created 4 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 | « chrome/browser/ui/search/search_tab_helper.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/searchbox/searchbox_extension.cc
diff --git a/chrome/renderer/searchbox/searchbox_extension.cc b/chrome/renderer/searchbox/searchbox_extension.cc
index 5dc7ae5ac91322ffd16f8e7eede21a2f2d861a8b..7e3af7acbd56f2b31effeb1550b5b91d746680d6 100644
--- a/chrome/renderer/searchbox/searchbox_extension.cc
+++ b/chrome/renderer/searchbox/searchbox_extension.cc
@@ -1164,7 +1164,9 @@ void SearchBoxExtensionWrapper::NavigateContentWindow(
DVLOG(1) << render_view << " NavigateContentWindow: " << destination_url;
- // Navigate the main frame.
+ // Navigate the main frame. Note that the security checks are enforced by the
+ // browser process in InstantService::IsValidURLForNavigation(), but some
+ // simple checks here are useful for avoiding unnecessary IPCs.
if (destination_url.is_valid() &&
!destination_url.SchemeIs(url::kJavaScriptScheme)) {
WindowOpenDisposition disposition = CURRENT_TAB;
« no previous file with comments | « chrome/browser/ui/search/search_tab_helper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698