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

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

Issue 2494633004: Remove about:srcdoc url conversion. (Closed)
Patch Set: Addressed comments (@creis) Created 4 years, 1 month 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/history/history_utils.h" 5 #include "chrome/browser/history/history_utils.h"
6 6
7 #include "chrome/common/url_constants.h" 7 #include "chrome/common/url_constants.h"
8 #include "components/dom_distiller/core/url_constants.h" 8 #include "components/dom_distiller/core/url_constants.h"
9 #include "url/gurl.h" 9 #include "url/gurl.h"
10 10
11 bool CanAddURLToHistory(const GURL& url) { 11 bool CanAddURLToHistory(const GURL& url) {
12 if (!url.is_valid()) 12 if (!url.is_valid())
13 return false; 13 return false;
14 14
15 // TODO: We should allow kChromeUIScheme URLs if they have been explicitly 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 16 // typed. Right now, however, these are marked as typed even when triggered
17 // by a shortcut or menu action. 17 // by a shortcut or menu action.
18 // Right now, URLs like about:version are not registered in the history. 18 // Right now, URLs like about:version are not registered in the history.
19 if (url.SchemeIs(url::kJavaScriptScheme) || 19 if (url.SchemeIs(url::kJavaScriptScheme) ||
20 url.SchemeIs(url::kAboutScheme) ||
arthursonzogni 2016/11/17 17:04:58 FYI: from what I understood, about:xxxx URLs are r
20 url.SchemeIs(content::kChromeDevToolsScheme) || 21 url.SchemeIs(content::kChromeDevToolsScheme) ||
21 url.SchemeIs(content::kChromeUIScheme) || 22 url.SchemeIs(content::kChromeUIScheme) ||
22 url.SchemeIs(content::kViewSourceScheme) || 23 url.SchemeIs(content::kViewSourceScheme) ||
23 url.SchemeIs(chrome::kChromeNativeScheme) || 24 url.SchemeIs(chrome::kChromeNativeScheme) ||
24 url.SchemeIs(chrome::kChromeSearchScheme) || 25 url.SchemeIs(chrome::kChromeSearchScheme) ||
25 url.SchemeIs(dom_distiller::kDomDistillerScheme)) 26 url.SchemeIs(dom_distiller::kDomDistillerScheme))
26 return false; 27 return false;
27 28
28 if (url == url::kAboutBlankURL)
29 return false;
30
31 return true; 29 return true;
32 } 30 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc ('k') | chrome/browser/prerender/prerender_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698