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_BACKEND_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ |
6 #define CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ | 6 #define CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 | 571 |
572 // Returns the name of the Favicons database. This is the new name | 572 // Returns the name of the Favicons database. This is the new name |
573 // of the Thumbnails database. | 573 // of the Thumbnails database. |
574 // See ThumbnailDatabase::RenameAndDropThumbnails. | 574 // See ThumbnailDatabase::RenameAndDropThumbnails. |
575 base::FilePath GetFaviconsFileName() const; | 575 base::FilePath GetFaviconsFileName() const; |
576 base::FilePath GetArchivedFileName() const; | 576 base::FilePath GetArchivedFileName() const; |
577 | 577 |
578 #if defined(OS_ANDROID) | 578 #if defined(OS_ANDROID) |
579 // Returns the name of android cache database. | 579 // Returns the name of android cache database. |
580 base::FilePath GetAndroidCacheFileName() const; | 580 base::FilePath GetAndroidCacheFileName() const; |
| 581 |
| 582 // Populate a map from a |MostVisitedURLList|. The map assigns a rank to each |
| 583 // top URL and its redirects. This should only be done once at backend |
| 584 // initialization. |
| 585 // This can be removed for M31. (See issue 248761.) |
| 586 |
| 587 void PopulateMostVisitedURLMap(); |
| 588 // Record counts of page visits by rank. If a url is not ranked, record the |
| 589 // page visit in a slot corresponding to |max_top_url_count|, which should |
| 590 // be one greater than the largest rank of any url in |top_urls|. |
| 591 // This can be removed for M31. (See issue 248761.) |
| 592 void RecordTopPageVisitStats(const GURL& url); |
581 #endif | 593 #endif |
582 | 594 |
583 class URLQuerier; | 595 class URLQuerier; |
584 friend class URLQuerier; | 596 friend class URLQuerier; |
585 | 597 |
586 // Does the work of Init. | 598 // Does the work of Init. |
587 void InitImpl(const std::string& languages); | 599 void InitImpl(const std::string& languages); |
588 | 600 |
589 // Closes all databases managed by HistoryBackend. Commits any pending | 601 // Closes all databases managed by HistoryBackend. Commits any pending |
590 // transactions. | 602 // transactions. |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
902 // loaded. | 914 // loaded. |
903 BookmarkService* bookmark_service_; | 915 BookmarkService* bookmark_service_; |
904 | 916 |
905 // Publishes the history to all indexers which are registered to receive | 917 // Publishes the history to all indexers which are registered to receive |
906 // history data from us. Can be NULL if there are no listeners. | 918 // history data from us. Can be NULL if there are no listeners. |
907 scoped_ptr<HistoryPublisher> history_publisher_; | 919 scoped_ptr<HistoryPublisher> history_publisher_; |
908 | 920 |
909 #if defined(OS_ANDROID) | 921 #if defined(OS_ANDROID) |
910 // Used to provide the Android ContentProvider APIs. | 922 // Used to provide the Android ContentProvider APIs. |
911 scoped_ptr<AndroidProviderBackend> android_provider_backend_; | 923 scoped_ptr<AndroidProviderBackend> android_provider_backend_; |
| 924 |
| 925 // Used to provide UMA on the number of page visits that are to the most |
| 926 // visited URLs. This is here because the backend both has access to this |
| 927 // information and is notified of page visits. The top sites service should |
| 928 // be used instead whenever possible. |
| 929 std::map<GURL, int> most_visited_urls_map_; |
912 #endif | 930 #endif |
913 | 931 |
914 // Used to manage syncing of the typed urls datatype. This will be NULL | 932 // Used to manage syncing of the typed urls datatype. This will be NULL |
915 // before Init is called. | 933 // before Init is called. |
916 scoped_ptr<TypedUrlSyncableService> typed_url_syncable_service_; | 934 scoped_ptr<TypedUrlSyncableService> typed_url_syncable_service_; |
917 | 935 |
918 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); | 936 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); |
919 }; | 937 }; |
920 | 938 |
921 } // namespace history | 939 } // namespace history |
922 | 940 |
923 #endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ | 941 #endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ |
OLD | NEW |