| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // The history system runs on a background thread so that potentially slow | 5 // The history system runs on a background thread so that potentially slow |
| 6 // database operations don't delay the browser. This backend processing is | 6 // database operations don't delay the browser. This backend processing is |
| 7 // represented by HistoryBackend. The HistoryService's job is to dispatch to | 7 // represented by HistoryBackend. The HistoryService's job is to dispatch to |
| 8 // that thread. | 8 // that thread. |
| 9 // | 9 // |
| 10 // Main thread History thread | 10 // Main thread History thread |
| (...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 972 } | 972 } |
| 973 | 973 |
| 974 // static | 974 // static |
| 975 bool HistoryService::CanAddURL(const GURL& url) { | 975 bool HistoryService::CanAddURL(const GURL& url) { |
| 976 if (!url.is_valid()) | 976 if (!url.is_valid()) |
| 977 return false; | 977 return false; |
| 978 | 978 |
| 979 // TODO: We should allow kChromeUIScheme URLs if they have been explicitly | 979 // TODO: We should allow kChromeUIScheme URLs if they have been explicitly |
| 980 // typed. Right now, however, these are marked as typed even when triggered | 980 // typed. Right now, however, these are marked as typed even when triggered |
| 981 // by a shortcut or menu action. | 981 // by a shortcut or menu action. |
| 982 if (url.SchemeIs(content::kJavaScriptScheme) || | 982 if (url.SchemeIs(url::kJavaScriptScheme) || |
| 983 url.SchemeIs(content::kChromeDevToolsScheme) || | 983 url.SchemeIs(content::kChromeDevToolsScheme) || |
| 984 url.SchemeIs(content::kChromeUIScheme) || | 984 url.SchemeIs(content::kChromeUIScheme) || |
| 985 url.SchemeIs(content::kViewSourceScheme) || | 985 url.SchemeIs(content::kViewSourceScheme) || |
| 986 url.SchemeIs(chrome::kChromeNativeScheme) || | 986 url.SchemeIs(chrome::kChromeNativeScheme) || |
| 987 url.SchemeIs(chrome::kChromeSearchScheme) || | 987 url.SchemeIs(chrome::kChromeSearchScheme) || |
| 988 url.SchemeIs(chrome::kDomDistillerScheme)) | 988 url.SchemeIs(chrome::kDomDistillerScheme)) |
| 989 return false; | 989 return false; |
| 990 | 990 |
| 991 // Allow all about: and chrome: URLs except about:blank, since the user may | 991 // Allow all about: and chrome: URLs except about:blank, since the user may |
| 992 // like to see "chrome://memory/", etc. in their history and autocomplete. | 992 // like to see "chrome://memory/", etc. in their history and autocomplete. |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1186 DCHECK(thread_checker_.CalledOnValidThread()); | 1186 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1187 visit_database_observers_.RemoveObserver(observer); | 1187 visit_database_observers_.RemoveObserver(observer); |
| 1188 } | 1188 } |
| 1189 | 1189 |
| 1190 void HistoryService::NotifyVisitDBObserversOnAddVisit( | 1190 void HistoryService::NotifyVisitDBObserversOnAddVisit( |
| 1191 const history::BriefVisitInfo& info) { | 1191 const history::BriefVisitInfo& info) { |
| 1192 DCHECK(thread_checker_.CalledOnValidThread()); | 1192 DCHECK(thread_checker_.CalledOnValidThread()); |
| 1193 FOR_EACH_OBSERVER(history::VisitDatabaseObserver, visit_database_observers_, | 1193 FOR_EACH_OBSERVER(history::VisitDatabaseObserver, visit_database_observers_, |
| 1194 OnAddVisit(info)); | 1194 OnAddVisit(info)); |
| 1195 } | 1195 } |
| OLD | NEW |