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

Side by Side Diff: chrome/browser/history/history_utils.cc

Issue 971423002: Abstract code filtering URLs added to the history (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@keyed-service
Patch Set: Created 5 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/history/history_utils.h"
6
7 #include "chrome/common/url_constants.h"
8 #include "components/dom_distiller/core/url_constants.h"
9 #include "url/gurl.h"
10
11 bool CanAddURLToHistory(const GURL& url) {
12 if (!url.is_valid())
13 return false;
14
15 // TODO: We should allow kChromeUIScheme URLs if they have been explicitly
16 // typed. Right now, however, these are marked as typed even when triggered
17 // by a shortcut or menu action.
18 if (url.SchemeIs(url::kJavaScriptScheme) ||
19 url.SchemeIs(content::kChromeDevToolsScheme) ||
20 url.SchemeIs(content::kChromeUIScheme) ||
21 url.SchemeIs(content::kViewSourceScheme) ||
22 url.SchemeIs(chrome::kChromeNativeScheme) ||
23 url.SchemeIs(chrome::kChromeSearchScheme) ||
24 url.SchemeIs(dom_distiller::kDomDistillerScheme))
25 return false;
26
27 // Allow all about: and chrome: URLs except about:blank, since the user may
28 // like to see "chrome://memory/", etc. in their history and autocomplete.
29 if (url == GURL(url::kAboutBlankURL))
30 return false;
31
32 return true;
33 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698