OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 ScheduleAndForget(PRIORITY_UI, &HistoryBackend::ScheduleAutocomplete, | 642 ScheduleAndForget(PRIORITY_UI, &HistoryBackend::ScheduleAutocomplete, |
643 scoped_refptr<HistoryURLProvider>(provider), params); | 643 scoped_refptr<HistoryURLProvider>(provider), params); |
644 } | 644 } |
645 | 645 |
646 void HistoryService::ScheduleTask(SchedulePriority priority, | 646 void HistoryService::ScheduleTask(SchedulePriority priority, |
647 Task* task) { | 647 Task* task) { |
648 // FIXME(brettw) do prioritization. | 648 // FIXME(brettw) do prioritization. |
649 thread_->message_loop()->PostTask(FROM_HERE, task); | 649 thread_->message_loop()->PostTask(FROM_HERE, task); |
650 } | 650 } |
651 | 651 |
652 bool HistoryService::CanAddURL(const GURL& url) const { | 652 // static |
| 653 bool HistoryService::CanAddURL(const GURL& url) { |
653 if (!url.is_valid()) | 654 if (!url.is_valid()) |
654 return false; | 655 return false; |
655 | 656 |
656 // TODO: We should allow kChromeUIScheme URLs if they have been explicitly | 657 // TODO: We should allow kChromeUIScheme URLs if they have been explicitly |
657 // typed. Right now, however, these are marked as typed even when triggered | 658 // typed. Right now, however, these are marked as typed even when triggered |
658 // by a shortcut or menu action. | 659 // by a shortcut or menu action. |
659 if (url.SchemeIs(chrome::kJavaScriptScheme) || | 660 if (url.SchemeIs(chrome::kJavaScriptScheme) || |
660 url.SchemeIs(chrome::kChromeUIScheme) || | 661 url.SchemeIs(chrome::kChromeUIScheme) || |
661 url.SchemeIs(chrome::kViewSourceScheme) || | 662 url.SchemeIs(chrome::kViewSourceScheme) || |
662 url.SchemeIs(chrome::kChromeInternalScheme)) | 663 url.SchemeIs(chrome::kChromeInternalScheme)) |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 | 753 |
753 void HistoryService::StartTopSitesMigration() { | 754 void HistoryService::StartTopSitesMigration() { |
754 history::TopSites* ts = profile_->GetTopSites(); | 755 history::TopSites* ts = profile_->GetTopSites(); |
755 ts->StartMigration(); | 756 ts->StartMigration(); |
756 } | 757 } |
757 | 758 |
758 void HistoryService::OnTopSitesReady() { | 759 void HistoryService::OnTopSitesReady() { |
759 ScheduleAndForget(PRIORITY_NORMAL, | 760 ScheduleAndForget(PRIORITY_NORMAL, |
760 &HistoryBackend::MigrateThumbnailsDatabase); | 761 &HistoryBackend::MigrateThumbnailsDatabase); |
761 } | 762 } |
OLD | NEW |