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 #ifndef CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ |
6 #define CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ | 6 #define CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 class PageUsageRequest; | 46 class PageUsageRequest; |
47 class Profile; | 47 class Profile; |
48 struct ImportedFaviconUsage; | 48 struct ImportedFaviconUsage; |
49 class SkBitmap; | 49 class SkBitmap; |
50 | 50 |
51 namespace base { | 51 namespace base { |
52 class FilePath; | 52 class FilePath; |
53 class Thread; | 53 class Thread; |
54 } | 54 } |
55 | 55 |
| 56 namespace safe_browsing { |
| 57 class LastDownloadFinder; |
| 58 } |
| 59 |
56 namespace visitedlink { | 60 namespace visitedlink { |
57 class VisitedLinkMaster; | 61 class VisitedLinkMaster; |
58 } | 62 } |
59 | 63 |
60 namespace history { | 64 namespace history { |
61 | 65 |
62 class HistoryBackend; | 66 class HistoryBackend; |
63 class HistoryClient; | 67 class HistoryClient; |
64 class HistoryDatabase; | 68 class HistoryDatabase; |
65 class HistoryDBTask; | 69 class HistoryDBTask; |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 friend class FaviconService; | 536 friend class FaviconService; |
533 friend class history::HistoryBackend; | 537 friend class history::HistoryBackend; |
534 friend class history::HistoryQueryTest; | 538 friend class history::HistoryQueryTest; |
535 friend class HistoryOperation; | 539 friend class HistoryOperation; |
536 friend class HistoryQuickProviderTest; | 540 friend class HistoryQuickProviderTest; |
537 friend class history::HistoryTest; | 541 friend class history::HistoryTest; |
538 friend class HistoryURLProvider; | 542 friend class HistoryURLProvider; |
539 friend class HistoryURLProviderTest; | 543 friend class HistoryURLProviderTest; |
540 friend class history::InMemoryURLIndexTest; | 544 friend class history::InMemoryURLIndexTest; |
541 template<typename Info, typename Callback> friend class DownloadRequest; | 545 template<typename Info, typename Callback> friend class DownloadRequest; |
| 546 friend class safe_browsing::LastDownloadFinder; |
542 friend class PageUsageRequest; | 547 friend class PageUsageRequest; |
543 friend class RedirectRequest; | 548 friend class RedirectRequest; |
| 549 friend class SyncBookmarkDataTypeControllerTest; |
544 friend class TestingProfile; | 550 friend class TestingProfile; |
545 | 551 |
546 // Called on shutdown, this will tell the history backend to complete and | 552 // Called on shutdown, this will tell the history backend to complete and |
547 // will release pointers to it. No other functions should be called once | 553 // will release pointers to it. No other functions should be called once |
548 // cleanup has happened that may dispatch to the history thread (because it | 554 // cleanup has happened that may dispatch to the history thread (because it |
549 // will be NULL). | 555 // will be NULL). |
550 // | 556 // |
551 // In practice, this will be called by the service manager (BrowserProcess) | 557 // In practice, this will be called by the service manager (BrowserProcess) |
552 // when it is being destroyed. Because that reference is being destroyed, it | 558 // when it is being destroyed. Because that reference is being destroyed, it |
553 // should be impossible for anybody else to call the service, even if it is | 559 // should be impossible for anybody else to call the service, even if it is |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 // The |row| ID will be set to the value that is currently in effect in the | 602 // The |row| ID will be set to the value that is currently in effect in the |
597 // main history database. |redirects| is the list of redirects leading up to | 603 // main history database. |redirects| is the list of redirects leading up to |
598 // the URL. If we have a redirect chain A -> B -> C and user is visiting C, | 604 // the URL. If we have a redirect chain A -> B -> C and user is visiting C, |
599 // then |redirects[0]=B| and |redirects[1]=A|. If there are no redirects, | 605 // then |redirects[0]=B| and |redirects[1]=A|. If there are no redirects, |
600 // |redirects| is an empty vector. | 606 // |redirects| is an empty vector. |
601 void NotifyURLVisited(ui::PageTransition transition, | 607 void NotifyURLVisited(ui::PageTransition transition, |
602 const history::URLRow& row, | 608 const history::URLRow& row, |
603 const history::RedirectList& redirects, | 609 const history::RedirectList& redirects, |
604 base::Time visit_time); | 610 base::Time visit_time); |
605 | 611 |
| 612 // Notify all HistoryServiceObservers registered that the |
| 613 // HistoryService has finished loading. |
| 614 void NotifyHistoryServiceLoaded(); |
| 615 |
606 // Favicon ------------------------------------------------------------------- | 616 // Favicon ------------------------------------------------------------------- |
607 | 617 |
608 // These favicon methods are exposed to the FaviconService. Instead of calling | 618 // These favicon methods are exposed to the FaviconService. Instead of calling |
609 // these methods directly you should call the respective method on the | 619 // these methods directly you should call the respective method on the |
610 // FaviconService. | 620 // FaviconService. |
611 | 621 |
612 // Used by FaviconService to get the favicon bitmaps from the history backend | 622 // Used by FaviconService to get the favicon bitmaps from the history backend |
613 // whose edge sizes most closely match |desired_sizes| for |icon_types|. If | 623 // whose edge sizes most closely match |desired_sizes| for |icon_types|. If |
614 // |desired_sizes| has a '0' entry, the largest favicon bitmap for | 624 // |desired_sizes| has a '0' entry, the largest favicon bitmap for |
615 // |icon_types| is returned. The returned FaviconBitmapResults will have at | 625 // |icon_types| is returned. The returned FaviconBitmapResults will have at |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 const ArgB& b, | 844 const ArgB& b, |
835 const ArgC& c, | 845 const ArgC& c, |
836 const ArgD& d, | 846 const ArgD& d, |
837 const ArgE& e) { | 847 const ArgE& e) { |
838 DCHECK(thread_) << "History service being called after cleanup"; | 848 DCHECK(thread_) << "History service being called after cleanup"; |
839 DCHECK(thread_checker_.CalledOnValidThread()); | 849 DCHECK(thread_checker_.CalledOnValidThread()); |
840 ScheduleTask(priority, base::Bind(func, history_backend_.get(), | 850 ScheduleTask(priority, base::Bind(func, history_backend_.get(), |
841 a, b, c, d, e)); | 851 a, b, c, d, e)); |
842 } | 852 } |
843 | 853 |
| 854 // TODO(sdefresne): http://crbug.com/430070 remove this method. |
| 855 Profile* profile() { return profile_; } |
| 856 |
844 base::ThreadChecker thread_checker_; | 857 base::ThreadChecker thread_checker_; |
845 | 858 |
846 content::NotificationRegistrar registrar_; | 859 content::NotificationRegistrar registrar_; |
847 | 860 |
848 // The thread used by the history service to run complicated operations. | 861 // The thread used by the history service to run complicated operations. |
849 // |thread_| is NULL once |Cleanup| is NULL. | 862 // |thread_| is NULL once |Cleanup| is NULL. |
850 base::Thread* thread_; | 863 base::Thread* thread_; |
851 | 864 |
852 // This class has most of the implementation and runs on the 'thread_'. | 865 // This class has most of the implementation and runs on the 'thread_'. |
853 // You MUST communicate with this class ONLY through the thread_'s | 866 // You MUST communicate with this class ONLY through the thread_'s |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
893 | 906 |
894 history::DeleteDirectiveHandler delete_directive_handler_; | 907 history::DeleteDirectiveHandler delete_directive_handler_; |
895 | 908 |
896 // All vended weak pointers are invalidated in Cleanup(). | 909 // All vended weak pointers are invalidated in Cleanup(). |
897 base::WeakPtrFactory<HistoryService> weak_ptr_factory_; | 910 base::WeakPtrFactory<HistoryService> weak_ptr_factory_; |
898 | 911 |
899 DISALLOW_COPY_AND_ASSIGN(HistoryService); | 912 DISALLOW_COPY_AND_ASSIGN(HistoryService); |
900 }; | 913 }; |
901 | 914 |
902 #endif // CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ | 915 #endif // CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ |
OLD | NEW |