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

Unified Diff: chrome/browser/search/instant_service.cc

Issue 1908363002: Nuke chrome.embeddedeseach.newTabPage.navigateContentWindow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 7 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/search/instant_service.h ('k') | chrome/browser/search/instant_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/search/instant_service.cc
diff --git a/chrome/browser/search/instant_service.cc b/chrome/browser/search/instant_service.cc
index ef1594dd7f8848482d4457a861cbf1953f42a3cf..8c66c420d9d620ca55d5f4220910a7db9e0908e8 100644
--- a/chrome/browser/search/instant_service.cc
+++ b/chrome/browser/search/instant_service.cc
@@ -7,7 +7,6 @@
#include <stddef.h>
#include "base/metrics/field_trial.h"
-#include "base/metrics/histogram_macros.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
@@ -63,22 +62,6 @@
namespace {
-// Used in a histogram; don't reorder, insert new values only at the end, and
-// keep in sync with "NtpMostVisitedScheme" in histograms.xml.
-enum class HistogramScheme {
- OTHER,
- OTHER_WEBSAFE,
- HTTP,
- HTTPS,
- FTP,
- FILE,
- CHROME,
- EXTENSION,
- JAVASCRIPT,
- // Insert new values here.
- COUNT
-};
-
const char kLocalNTPSuggestionService[] = "LocalNTPSuggestionsService";
const char kLocalNTPSuggestionServiceEnabled[] = "Enabled";
@@ -308,53 +291,6 @@ void InstantService::SendSearchURLsToRenderer(content::RenderProcessHost* rph) {
search::GetSearchURLs(profile_), search::GetNewTabPageURL(profile_)));
}
-bool InstantService::IsValidURLForNavigation(const GURL& url) const {
- HistogramScheme scheme = HistogramScheme::OTHER;
- if (url.SchemeIs(url::kHttpScheme)) {
- scheme = HistogramScheme::HTTP;
- } else if (url.SchemeIs(url::kHttpsScheme)) {
- scheme = HistogramScheme::HTTPS;
- } else if (url.SchemeIs(url::kFtpScheme)) {
- scheme = HistogramScheme::FTP;
- } else if (url.SchemeIsFile()) {
- scheme = HistogramScheme::FILE;
- } else if (url.SchemeIs(content::kChromeUIScheme)) {
- scheme = HistogramScheme::CHROME;
- } else if (url.SchemeIs(extensions::kExtensionScheme)) {
- scheme = HistogramScheme::EXTENSION;
- } else if (url.SchemeIs(url::kJavaScriptScheme)) {
- scheme = HistogramScheme::JAVASCRIPT;
- } else if (content::ChildProcessSecurityPolicy::GetInstance()
- ->IsWebSafeScheme(url.scheme())) {
- scheme = HistogramScheme::OTHER_WEBSAFE;
- }
- UMA_HISTOGRAM_ENUMERATION("NewTabPage.MostVisitedScheme",
- static_cast<int32_t>(scheme),
- static_cast<int32_t>(HistogramScheme::COUNT));
-
- // Certain URLs are privileged and should never be considered valid
- // navigation targets.
- // TODO(treib): Ideally this should deny by default and only allow if the
- // scheme passes the content::ChildProcessSecurityPolicy::IsWebSafeScheme()
- // check.
- if (url.SchemeIs(content::kChromeUIScheme))
- return false;
-
- // javascript: URLs never make sense as a most visited item either.
- if (url.SchemeIs(url::kJavaScriptScheme))
- return false;
-
- for (const auto& item : most_visited_items_) {
- if (item.url == url)
- return true;
- }
- for (const auto& item : suggestions_items_) {
- if (item.url == url)
- return true;
- }
- return false;
-}
-
void InstantService::OnRendererProcessTerminated(int process_id) {
process_ids_.erase(process_id);
« no previous file with comments | « chrome/browser/search/instant_service.h ('k') | chrome/browser/search/instant_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698