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