OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 // TODO: We should allow kChromeUIScheme URLs if they have been explicitly | 697 // TODO: We should allow kChromeUIScheme URLs if they have been explicitly |
698 // typed. Right now, however, these are marked as typed even when triggered | 698 // typed. Right now, however, these are marked as typed even when triggered |
699 // by a shortcut or menu action. | 699 // by a shortcut or menu action. |
700 if (url.SchemeIs(chrome::kJavaScriptScheme) || | 700 if (url.SchemeIs(chrome::kJavaScriptScheme) || |
701 url.SchemeIs(chrome::kChromeDevToolsScheme) || | 701 url.SchemeIs(chrome::kChromeDevToolsScheme) || |
702 url.SchemeIs(chrome::kChromeUIScheme) || | 702 url.SchemeIs(chrome::kChromeUIScheme) || |
703 url.SchemeIs(chrome::kViewSourceScheme) || | 703 url.SchemeIs(chrome::kViewSourceScheme) || |
704 url.SchemeIs(chrome::kChromeInternalScheme)) | 704 url.SchemeIs(chrome::kChromeInternalScheme)) |
705 return false; | 705 return false; |
706 | 706 |
707 if (url.SchemeIs(chrome::kAboutScheme)) { | 707 // Allow all about: and chrome: URLs except about:blank, since the user may |
708 if (LowerCaseEqualsASCII(url.path(), "blank")) | 708 // like to see "chrome://memory/", etc. in their history and autocomplete. |
709 return false; | 709 if (url == GURL(chrome::kAboutBlankURL)) |
710 // We allow all other about URLs since the user may like to see things | 710 return false; |
711 // like "about:memory" or "about:histograms" in their history and | |
712 // autocomplete. | |
713 } | |
714 | 711 |
715 return true; | 712 return true; |
716 } | 713 } |
717 | 714 |
718 void HistoryService::SetInMemoryBackend( | 715 void HistoryService::SetInMemoryBackend( |
719 history::InMemoryHistoryBackend* mem_backend) { | 716 history::InMemoryHistoryBackend* mem_backend) { |
720 DCHECK(!in_memory_backend_.get()) << "Setting mem DB twice"; | 717 DCHECK(!in_memory_backend_.get()) << "Setting mem DB twice"; |
721 in_memory_backend_.reset(mem_backend); | 718 in_memory_backend_.reset(mem_backend); |
722 | 719 |
723 // The database requires additional initialization once we own it. | 720 // The database requires additional initialization once we own it. |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
813 history::TopSites* ts = profile_->GetTopSitesWithoutCreating(); | 810 history::TopSites* ts = profile_->GetTopSitesWithoutCreating(); |
814 if (ts) | 811 if (ts) |
815 ts->MigrateFromHistory(); | 812 ts->MigrateFromHistory(); |
816 } | 813 } |
817 } | 814 } |
818 | 815 |
819 void HistoryService::OnTopSitesReady() { | 816 void HistoryService::OnTopSitesReady() { |
820 ScheduleAndForget(PRIORITY_NORMAL, | 817 ScheduleAndForget(PRIORITY_NORMAL, |
821 &HistoryBackend::MigrateThumbnailsDatabase); | 818 &HistoryBackend::MigrateThumbnailsDatabase); |
822 } | 819 } |
OLD | NEW |