| 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 10 matching lines...) Expand all Loading... |
| 21 #include "chrome/browser/history/history_types.h" | 21 #include "chrome/browser/history/history_types.h" |
| 22 #include "chrome/browser/history/text_database_manager.h" | 22 #include "chrome/browser/history/text_database_manager.h" |
| 23 #include "chrome/browser/history/thumbnail_database.h" | 23 #include "chrome/browser/history/thumbnail_database.h" |
| 24 #include "chrome/browser/history/visit_tracker.h" | 24 #include "chrome/browser/history/visit_tracker.h" |
| 25 #include "chrome/browser/search_engines/template_url_id.h" | 25 #include "chrome/browser/search_engines/template_url_id.h" |
| 26 #include "sql/init_status.h" | 26 #include "sql/init_status.h" |
| 27 #include "ui/base/layout.h" | 27 #include "ui/base/layout.h" |
| 28 | 28 |
| 29 class BookmarkService; | 29 class BookmarkService; |
| 30 class TestingProfile; | 30 class TestingProfile; |
| 31 class TypedUrlSyncableService; |
| 31 struct ThumbnailScore; | 32 struct ThumbnailScore; |
| 32 | 33 |
| 33 namespace history { | 34 namespace history { |
| 34 #if defined(OS_ANDROID) | 35 #if defined(OS_ANDROID) |
| 35 class AndroidProviderBackend; | 36 class AndroidProviderBackend; |
| 36 #endif | 37 #endif |
| 37 | 38 |
| 38 class CommitLaterTask; | 39 class CommitLaterTask; |
| 39 class HistoryPublisher; | 40 class HistoryPublisher; |
| 40 class VisitFilter; | 41 class VisitFilter; |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 | 423 |
| 423 virtual bool RemoveVisits(const VisitVector& visits); | 424 virtual bool RemoveVisits(const VisitVector& visits); |
| 424 | 425 |
| 425 // Returns the VisitSource associated with each one of the passed visits. | 426 // Returns the VisitSource associated with each one of the passed visits. |
| 426 // If there is no entry in the map for a given visit, that means the visit | 427 // If there is no entry in the map for a given visit, that means the visit |
| 427 // was SOURCE_BROWSED. Returns false if there is no HistoryDatabase.. | 428 // was SOURCE_BROWSED. Returns false if there is no HistoryDatabase.. |
| 428 bool GetVisitsSource(const VisitVector& visits, VisitSourceMap* sources); | 429 bool GetVisitsSource(const VisitVector& visits, VisitSourceMap* sources); |
| 429 | 430 |
| 430 virtual bool GetURL(const GURL& url, history::URLRow* url_row); | 431 virtual bool GetURL(const GURL& url, history::URLRow* url_row); |
| 431 | 432 |
| 433 // Returns the syncable service for syncing typed urls. The returned service |
| 434 // is owned by |this| object. |
| 435 virtual TypedUrlSyncableService* GetTypedUrlSyncableService() const; |
| 436 |
| 432 // Deleting ------------------------------------------------------------------ | 437 // Deleting ------------------------------------------------------------------ |
| 433 | 438 |
| 434 virtual void DeleteURLs(const std::vector<GURL>& urls); | 439 virtual void DeleteURLs(const std::vector<GURL>& urls); |
| 435 | 440 |
| 436 virtual void DeleteURL(const GURL& url); | 441 virtual void DeleteURL(const GURL& url); |
| 437 | 442 |
| 438 // Calls ExpireHistoryBackend::ExpireHistoryBetween and commits the change. | 443 // Calls ExpireHistoryBackend::ExpireHistoryBetween and commits the change. |
| 439 void ExpireHistoryBetween( | 444 void ExpireHistoryBetween( |
| 440 const std::set<GURL>& restrict_urls, | 445 const std::set<GURL>& restrict_urls, |
| 441 base::Time begin_time, | 446 base::Time begin_time, |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 775 | 780 |
| 776 // Release all tasks in history_db_tasks_ and clears it. | 781 // Release all tasks in history_db_tasks_ and clears it. |
| 777 void ReleaseDBTasks(); | 782 void ReleaseDBTasks(); |
| 778 | 783 |
| 779 // Schedules a broadcast of the given notification on the main thread. The | 784 // Schedules a broadcast of the given notification on the main thread. The |
| 780 // details argument will have ownership taken by this function (it will be | 785 // details argument will have ownership taken by this function (it will be |
| 781 // sent to the main thread and deleted there). | 786 // sent to the main thread and deleted there). |
| 782 virtual void BroadcastNotifications(int type, | 787 virtual void BroadcastNotifications(int type, |
| 783 HistoryDetails* details_deleted) OVERRIDE; | 788 HistoryDetails* details_deleted) OVERRIDE; |
| 784 | 789 |
| 790 virtual void NotifySyncURLsDeleted(bool all_history, |
| 791 bool archived, |
| 792 URLRows* rows) OVERRIDE; |
| 793 |
| 785 // Deleting all history ------------------------------------------------------ | 794 // Deleting all history ------------------------------------------------------ |
| 786 | 795 |
| 787 // Deletes all history. This is a special case of deleting that is separated | 796 // Deletes all history. This is a special case of deleting that is separated |
| 788 // from our normal dependency-following method for performance reasons. The | 797 // from our normal dependency-following method for performance reasons. The |
| 789 // logic lives here instead of ExpireHistoryBackend since it will cause | 798 // logic lives here instead of ExpireHistoryBackend since it will cause |
| 790 // re-initialization of some databases such as Thumbnails or Archived that | 799 // re-initialization of some databases such as Thumbnails or Archived that |
| 791 // could fail. When these databases are not valid, our pointers must be NULL, | 800 // could fail. When these databases are not valid, our pointers must be NULL, |
| 792 // so we need to handle this type of operation to keep the pointers in sync. | 801 // so we need to handle this type of operation to keep the pointers in sync. |
| 793 void DeleteAllHistory(); | 802 void DeleteAllHistory(); |
| 794 | 803 |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 888 | 897 |
| 889 // Publishes the history to all indexers which are registered to receive | 898 // Publishes the history to all indexers which are registered to receive |
| 890 // history data from us. Can be NULL if there are no listeners. | 899 // history data from us. Can be NULL if there are no listeners. |
| 891 scoped_ptr<HistoryPublisher> history_publisher_; | 900 scoped_ptr<HistoryPublisher> history_publisher_; |
| 892 | 901 |
| 893 #if defined(OS_ANDROID) | 902 #if defined(OS_ANDROID) |
| 894 // Used to provide the Android ContentProvider APIs. | 903 // Used to provide the Android ContentProvider APIs. |
| 895 scoped_ptr<AndroidProviderBackend> android_provider_backend_; | 904 scoped_ptr<AndroidProviderBackend> android_provider_backend_; |
| 896 #endif | 905 #endif |
| 897 | 906 |
| 907 // Used to manage syncing of the typed urls datatype. This will be NULL |
| 908 // before Init is called. |
| 909 scoped_ptr<TypedUrlSyncableService> typed_url_syncable_service_; |
| 910 |
| 898 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); | 911 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); |
| 899 }; | 912 }; |
| 900 | 913 |
| 901 } // namespace history | 914 } // namespace history |
| 902 | 915 |
| 903 #endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ | 916 #endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ |
| OLD | NEW |