| 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 #ifndef CHROME_BROWSER_HISTORY_HISTORY_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_HISTORY_H_ |
| 6 #define CHROME_BROWSER_HISTORY_HISTORY_H_ | 6 #define CHROME_BROWSER_HISTORY_HISTORY_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 void NotifyRenderProcessHostDestruction(const void* host); | 136 void NotifyRenderProcessHostDestruction(const void* host); |
| 137 | 137 |
| 138 // Triggers the backend to load if it hasn't already, and then returns the | 138 // Triggers the backend to load if it hasn't already, and then returns the |
| 139 // in-memory URL database. The returned pointer MAY BE NULL if the in-memory | 139 // in-memory URL database. The returned pointer MAY BE NULL if the in-memory |
| 140 // database has not been loaded yet. This pointer is owned by the history | 140 // database has not been loaded yet. This pointer is owned by the history |
| 141 // system. Callers should not store or cache this value. | 141 // system. Callers should not store or cache this value. |
| 142 // | 142 // |
| 143 // TODO(brettw) this should return the InMemoryHistoryBackend. | 143 // TODO(brettw) this should return the InMemoryHistoryBackend. |
| 144 history::URLDatabase* InMemoryDatabase(); | 144 history::URLDatabase* InMemoryDatabase(); |
| 145 | 145 |
| 146 // Returns the history database if it has been set, otherwise NULL. | 146 // Return the quick history index. |
| 147 history::URLDatabase* HistoryDatabase(); | 147 history::InMemoryURLIndex* InMemoryIndex(); |
| 148 | 148 |
| 149 // Navigation ---------------------------------------------------------------- | 149 // Navigation ---------------------------------------------------------------- |
| 150 | 150 |
| 151 // Adds the given canonical URL to history with the current time as the visit | 151 // Adds the given canonical URL to history with the current time as the visit |
| 152 // time. Referrer may be the empty string. | 152 // time. Referrer may be the empty string. |
| 153 // | 153 // |
| 154 // The supplied render process host is used to scope the given page ID. Page | 154 // The supplied render process host is used to scope the given page ID. Page |
| 155 // IDs are only unique inside a given render process, so we need that to | 155 // IDs are only unique inside a given render process, so we need that to |
| 156 // differentiate them. This pointer should not be dereferenced by the history | 156 // differentiate them. This pointer should not be dereferenced by the history |
| 157 // system. Since render view host pointers may be reused (if one gets deleted | 157 // system. Since render view host pointers may be reused (if one gets deleted |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 // specified text. The matching is case insensitive. The results are ordered | 495 // specified text. The matching is case insensitive. The results are ordered |
| 496 // in descending order up to |max_count| with the most recent search term | 496 // in descending order up to |max_count| with the most recent search term |
| 497 // first. | 497 // first. |
| 498 Handle GetMostRecentKeywordSearchTerms( | 498 Handle GetMostRecentKeywordSearchTerms( |
| 499 TemplateURLID keyword_id, | 499 TemplateURLID keyword_id, |
| 500 const string16& prefix, | 500 const string16& prefix, |
| 501 int max_count, | 501 int max_count, |
| 502 CancelableRequestConsumerBase* consumer, | 502 CancelableRequestConsumerBase* consumer, |
| 503 const GetMostRecentKeywordSearchTermsCallback& callback); | 503 const GetMostRecentKeywordSearchTermsCallback& callback); |
| 504 | 504 |
| 505 // InMemoryURLIndex ---------------------------------------------------------- | |
| 506 | |
| 507 // Returns the quick history index. | |
| 508 history::InMemoryURLIndex* InMemoryIndex(); | |
| 509 | |
| 510 // Bookmarks ----------------------------------------------------------------- | 505 // Bookmarks ----------------------------------------------------------------- |
| 511 | 506 |
| 512 // Notification that a URL is no longer bookmarked. | 507 // Notification that a URL is no longer bookmarked. |
| 513 void URLsNoLongerBookmarked(const std::set<GURL>& urls); | 508 void URLsNoLongerBookmarked(const std::set<GURL>& urls); |
| 514 | 509 |
| 515 // Generic Stuff ------------------------------------------------------------- | 510 // Generic Stuff ------------------------------------------------------------- |
| 516 | 511 |
| 517 // Schedules a HistoryDBTask for running on the history backend thread. See | 512 // Schedules a HistoryDBTask for running on the history backend thread. See |
| 518 // HistoryDBTask for details on what this does. | 513 // HistoryDBTask for details on what this does. |
| 519 virtual void ScheduleDBTask(HistoryDBTask* task, | 514 virtual void ScheduleDBTask(HistoryDBTask* task, |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 843 // | 838 // |
| 844 // This pointer will be NULL once Cleanup() has been called, meaning no | 839 // This pointer will be NULL once Cleanup() has been called, meaning no |
| 845 // more calls should be made to the history thread. | 840 // more calls should be made to the history thread. |
| 846 scoped_refptr<history::HistoryBackend> history_backend_; | 841 scoped_refptr<history::HistoryBackend> history_backend_; |
| 847 | 842 |
| 848 // A cache of the user-typed URLs kept in memory that is used by the | 843 // A cache of the user-typed URLs kept in memory that is used by the |
| 849 // autocomplete system. This will be NULL until the database has been created | 844 // autocomplete system. This will be NULL until the database has been created |
| 850 // on the background thread. | 845 // on the background thread. |
| 851 scoped_ptr<history::InMemoryHistoryBackend> in_memory_backend_; | 846 scoped_ptr<history::InMemoryHistoryBackend> in_memory_backend_; |
| 852 | 847 |
| 853 // The index used for quick history lookups. | |
| 854 scoped_ptr<history::InMemoryURLIndex> in_memory_url_index_; | |
| 855 | |
| 856 // The profile, may be null when testing. | 848 // The profile, may be null when testing. |
| 857 Profile* profile_; | 849 Profile* profile_; |
| 858 | 850 |
| 859 // Has the backend finished loading? The backend is loaded once Init has | 851 // Has the backend finished loading? The backend is loaded once Init has |
| 860 // completed. | 852 // completed. |
| 861 bool backend_loaded_; | 853 bool backend_loaded_; |
| 862 | 854 |
| 863 // The id of the current backend. This is only valid when history_backend_ | 855 // The id of the current backend. This is only valid when history_backend_ |
| 864 // is not NULL. | 856 // is not NULL. |
| 865 int current_backend_id_; | 857 int current_backend_id_; |
| 866 | 858 |
| 867 // Cached values from Init(), used whenever we need to reload the backend. | 859 // Cached values from Init(), used whenever we need to reload the backend. |
| 868 FilePath history_dir_; | 860 FilePath history_dir_; |
| 869 BookmarkService* bookmark_service_; | 861 BookmarkService* bookmark_service_; |
| 870 bool no_db_; | 862 bool no_db_; |
| 871 | 863 |
| 872 // True if needs top site migration. | 864 // True if needs top site migration. |
| 873 bool needs_top_sites_migration_; | 865 bool needs_top_sites_migration_; |
| 874 | 866 |
| 875 DISALLOW_COPY_AND_ASSIGN(HistoryService); | 867 DISALLOW_COPY_AND_ASSIGN(HistoryService); |
| 876 }; | 868 }; |
| 877 | 869 |
| 878 #endif // CHROME_BROWSER_HISTORY_HISTORY_H_ | 870 #endif // CHROME_BROWSER_HISTORY_HISTORY_H_ |
| OLD | NEW |