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 985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
996 bool HistoryService::CanAddURL(const GURL& url) { | 996 bool HistoryService::CanAddURL(const GURL& url) { |
997 if (!url.is_valid()) | 997 if (!url.is_valid()) |
998 return false; | 998 return false; |
999 | 999 |
1000 // TODO: We should allow kChromeUIScheme URLs if they have been explicitly | 1000 // TODO: We should allow kChromeUIScheme URLs if they have been explicitly |
1001 // typed. Right now, however, these are marked as typed even when triggered | 1001 // typed. Right now, however, these are marked as typed even when triggered |
1002 // by a shortcut or menu action. | 1002 // by a shortcut or menu action. |
1003 if (url.SchemeIs(chrome::kJavaScriptScheme) || | 1003 if (url.SchemeIs(chrome::kJavaScriptScheme) || |
1004 url.SchemeIs(chrome::kChromeDevToolsScheme) || | 1004 url.SchemeIs(chrome::kChromeDevToolsScheme) || |
1005 url.SchemeIs(chrome::kChromeUIScheme) || | 1005 url.SchemeIs(chrome::kChromeUIScheme) || |
1006 url.SchemeIs(chrome::kViewSourceScheme) || | 1006 url.SchemeIs(content::kViewSourceScheme) || |
1007 url.SchemeIs(chrome::kChromeInternalScheme)) | 1007 url.SchemeIs(chrome::kChromeInternalScheme)) |
1008 return false; | 1008 return false; |
1009 | 1009 |
1010 // Allow all about: and chrome: URLs except about:blank, since the user may | 1010 // Allow all about: and chrome: URLs except about:blank, since the user may |
1011 // like to see "chrome://memory/", etc. in their history and autocomplete. | 1011 // like to see "chrome://memory/", etc. in their history and autocomplete. |
1012 if (url == GURL(content::kAboutBlankURL)) | 1012 if (url == GURL(content::kAboutBlankURL)) |
1013 return false; | 1013 return false; |
1014 | 1014 |
1015 return true; | 1015 return true; |
1016 } | 1016 } |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1271 DCHECK(thread_checker_.CalledOnValidThread()); | 1271 DCHECK(thread_checker_.CalledOnValidThread()); |
1272 visit_database_observers_.RemoveObserver(observer); | 1272 visit_database_observers_.RemoveObserver(observer); |
1273 } | 1273 } |
1274 | 1274 |
1275 void HistoryService::NotifyVisitDBObserversOnAddVisit( | 1275 void HistoryService::NotifyVisitDBObserversOnAddVisit( |
1276 const history::BriefVisitInfo& info) { | 1276 const history::BriefVisitInfo& info) { |
1277 DCHECK(thread_checker_.CalledOnValidThread()); | 1277 DCHECK(thread_checker_.CalledOnValidThread()); |
1278 FOR_EACH_OBSERVER(history::VisitDatabaseObserver, visit_database_observers_, | 1278 FOR_EACH_OBSERVER(history::VisitDatabaseObserver, visit_database_observers_, |
1279 OnAddVisit(info)); | 1279 OnAddVisit(info)); |
1280 } | 1280 } |
OLD | NEW |