| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 class VisitedLinkMaster; | 57 class VisitedLinkMaster; |
| 58 } | 58 } |
| 59 | 59 |
| 60 namespace history { | 60 namespace history { |
| 61 | 61 |
| 62 class HistoryBackend; | 62 class HistoryBackend; |
| 63 class HistoryClient; | 63 class HistoryClient; |
| 64 class HistoryDatabase; | 64 class HistoryDatabase; |
| 65 class HistoryDBTask; | 65 class HistoryDBTask; |
| 66 class HistoryQueryTest; | 66 class HistoryQueryTest; |
| 67 class HistoryServiceObserver; |
| 67 class HistoryTest; | 68 class HistoryTest; |
| 68 class InMemoryHistoryBackend; | 69 class InMemoryHistoryBackend; |
| 69 class InMemoryURLIndex; | 70 class InMemoryURLIndex; |
| 70 class InMemoryURLIndexTest; | 71 class InMemoryURLIndexTest; |
| 71 class URLDatabase; | 72 class URLDatabase; |
| 72 class VisitDatabaseObserver; | 73 class VisitDatabaseObserver; |
| 73 class VisitFilter; | 74 class VisitFilter; |
| 74 struct DownloadRow; | 75 struct DownloadRow; |
| 75 struct HistoryAddPageArgs; | 76 struct HistoryAddPageArgs; |
| 76 struct HistoryDetails; | 77 struct HistoryDetails; |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 // Deletes all URL and search term entries matching the given |term| and | 424 // Deletes all URL and search term entries matching the given |term| and |
| 424 // |keyword_id|. | 425 // |keyword_id|. |
| 425 void DeleteMatchingURLsForKeyword(history::KeywordID keyword_id, | 426 void DeleteMatchingURLsForKeyword(history::KeywordID keyword_id, |
| 426 const base::string16& term); | 427 const base::string16& term); |
| 427 | 428 |
| 428 // Bookmarks ----------------------------------------------------------------- | 429 // Bookmarks ----------------------------------------------------------------- |
| 429 | 430 |
| 430 // Notification that a URL is no longer bookmarked. | 431 // Notification that a URL is no longer bookmarked. |
| 431 void URLsNoLongerBookmarked(const std::set<GURL>& urls); | 432 void URLsNoLongerBookmarked(const std::set<GURL>& urls); |
| 432 | 433 |
| 434 // HistoryServiceObserver ---------------------------------------------------- |
| 435 |
| 436 // Adds/Removes an HistoryServiceObserver. |
| 437 void AddHistoryServiceObserver(history::HistoryServiceObserver* observer); |
| 438 void RemoveHistoryServiceObserver(history::HistoryServiceObserver* observer); |
| 439 |
| 433 // Generic Stuff ------------------------------------------------------------- | 440 // Generic Stuff ------------------------------------------------------------- |
| 434 | 441 |
| 435 // Schedules a HistoryDBTask for running on the history backend thread. See | 442 // Schedules a HistoryDBTask for running on the history backend thread. See |
| 436 // HistoryDBTask for details on what this does. Takes ownership of |task|. | 443 // HistoryDBTask for details on what this does. Takes ownership of |task|. |
| 437 virtual void ScheduleDBTask(scoped_ptr<history::HistoryDBTask> task, | 444 virtual void ScheduleDBTask(scoped_ptr<history::HistoryDBTask> task, |
| 438 base::CancelableTaskTracker* tracker); | 445 base::CancelableTaskTracker* tracker); |
| 439 | 446 |
| 440 // Adds or removes observers for the VisitDatabase. | 447 // Adds or removes observers for the VisitDatabase. |
| 441 void AddVisitDatabaseObserver(history::VisitDatabaseObserver* observer); | 448 void AddVisitDatabaseObserver(history::VisitDatabaseObserver* observer); |
| 442 void RemoveVisitDatabaseObserver(history::VisitDatabaseObserver* observer); | 449 void RemoveVisitDatabaseObserver(history::VisitDatabaseObserver* observer); |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 | 589 |
| 583 // Notification from the backend that it has finished loading. Sends | 590 // Notification from the backend that it has finished loading. Sends |
| 584 // notification (NOTIFY_HISTORY_LOADED) and sets backend_loaded_ to true. | 591 // notification (NOTIFY_HISTORY_LOADED) and sets backend_loaded_ to true. |
| 585 void OnDBLoaded(); | 592 void OnDBLoaded(); |
| 586 | 593 |
| 587 // Helper function for getting URL information. | 594 // Helper function for getting URL information. |
| 588 // Reads a URLRow from in-memory database. Returns false if database is not | 595 // Reads a URLRow from in-memory database. Returns false if database is not |
| 589 // available or the URL does not exist. | 596 // available or the URL does not exist. |
| 590 bool GetRowForURL(const GURL& url, history::URLRow* url_row); | 597 bool GetRowForURL(const GURL& url, history::URLRow* url_row); |
| 591 | 598 |
| 599 // HistoryServiceObserver ---------------------------------------------------- |
| 600 |
| 601 // Notify all HistoryServiceObservers registered that user is visiting a URL. |
| 602 // The |row| ID will be set to the value that is currently in effect in the |
| 603 // main history database. |redirects| is the list of redirects leading up to |
| 604 // the URL. If we have a redirect chain A -> B -> C and user is visiting C, |
| 605 // then |redirects[0]=B| and |redirects[1]=A|. If there are no redirects, |
| 606 // |redirects| is an empty vector. |
| 607 void NotifyURLVisited(ui::PageTransition transition, |
| 608 const history::URLRow& row, |
| 609 const history::RedirectList& redirects, |
| 610 const base::Time& visit_time); |
| 611 |
| 592 // Favicon ------------------------------------------------------------------- | 612 // Favicon ------------------------------------------------------------------- |
| 593 | 613 |
| 594 // These favicon methods are exposed to the FaviconService. Instead of calling | 614 // These favicon methods are exposed to the FaviconService. Instead of calling |
| 595 // these methods directly you should call the respective method on the | 615 // these methods directly you should call the respective method on the |
| 596 // FaviconService. | 616 // FaviconService. |
| 597 | 617 |
| 598 // Used by FaviconService to get the favicon bitmaps from the history backend | 618 // Used by FaviconService to get the favicon bitmaps from the history backend |
| 599 // whose edge sizes most closely match |desired_sizes| for |icon_types|. If | 619 // whose edge sizes most closely match |desired_sizes| for |icon_types|. If |
| 600 // |desired_sizes| has a '0' entry, the largest favicon bitmap for | 620 // |desired_sizes| has a '0' entry, the largest favicon bitmap for |
| 601 // |icon_types| is returned. The returned FaviconBitmapResults will have at | 621 // |icon_types| is returned. The returned FaviconBitmapResults will have at |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 866 | 886 |
| 867 // Cached values from Init(), used whenever we need to reload the backend. | 887 // Cached values from Init(), used whenever we need to reload the backend. |
| 868 base::FilePath history_dir_; | 888 base::FilePath history_dir_; |
| 869 bool no_db_; | 889 bool no_db_; |
| 870 | 890 |
| 871 // The index used for quick history lookups. | 891 // The index used for quick history lookups. |
| 872 // TODO(mrossetti): Move in_memory_url_index out of history_service. | 892 // TODO(mrossetti): Move in_memory_url_index out of history_service. |
| 873 // See http://crbug.com/138321 | 893 // See http://crbug.com/138321 |
| 874 scoped_ptr<history::InMemoryURLIndex> in_memory_url_index_; | 894 scoped_ptr<history::InMemoryURLIndex> in_memory_url_index_; |
| 875 | 895 |
| 896 ObserverList<history::HistoryServiceObserver> history_service_observers_; |
| 876 ObserverList<history::VisitDatabaseObserver> visit_database_observers_; | 897 ObserverList<history::VisitDatabaseObserver> visit_database_observers_; |
| 877 | 898 |
| 878 base::CallbackList<void(const std::set<GURL>&)> | 899 base::CallbackList<void(const std::set<GURL>&)> |
| 879 favicon_changed_callback_list_; | 900 favicon_changed_callback_list_; |
| 880 | 901 |
| 881 history::DeleteDirectiveHandler delete_directive_handler_; | 902 history::DeleteDirectiveHandler delete_directive_handler_; |
| 882 | 903 |
| 883 // All vended weak pointers are invalidated in Cleanup(). | 904 // All vended weak pointers are invalidated in Cleanup(). |
| 884 base::WeakPtrFactory<HistoryService> weak_ptr_factory_; | 905 base::WeakPtrFactory<HistoryService> weak_ptr_factory_; |
| 885 | 906 |
| 886 DISALLOW_COPY_AND_ASSIGN(HistoryService); | 907 DISALLOW_COPY_AND_ASSIGN(HistoryService); |
| 887 }; | 908 }; |
| 888 | 909 |
| 889 #endif // CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ | 910 #endif // CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ |
| OLD | NEW |