| 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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 776 | 781 |
| 777 // Release all tasks in history_db_tasks_ and clears it. | 782 // Release all tasks in history_db_tasks_ and clears it. |
| 778 void ReleaseDBTasks(); | 783 void ReleaseDBTasks(); |
| 779 | 784 |
| 780 // Schedules a broadcast of the given notification on the main thread. The | 785 // Schedules a broadcast of the given notification on the main thread. The |
| 781 // details argument will have ownership taken by this function (it will be | 786 // details argument will have ownership taken by this function (it will be |
| 782 // sent to the main thread and deleted there). | 787 // sent to the main thread and deleted there). |
| 783 virtual void BroadcastNotifications(int type, | 788 virtual void BroadcastNotifications(int type, |
| 784 HistoryDetails* details_deleted) OVERRIDE; | 789 HistoryDetails* details_deleted) OVERRIDE; |
| 785 | 790 |
| 791 virtual void NotifySyncURLsDeleted(bool all_history, |
| 792 bool archived, |
| 793 URLRows* rows) OVERRIDE; |
| 794 |
| 786 // Deleting all history ------------------------------------------------------ | 795 // Deleting all history ------------------------------------------------------ |
| 787 | 796 |
| 788 // Deletes all history. This is a special case of deleting that is separated | 797 // Deletes all history. This is a special case of deleting that is separated |
| 789 // from our normal dependency-following method for performance reasons. The | 798 // from our normal dependency-following method for performance reasons. The |
| 790 // logic lives here instead of ExpireHistoryBackend since it will cause | 799 // logic lives here instead of ExpireHistoryBackend since it will cause |
| 791 // re-initialization of some databases such as Thumbnails or Archived that | 800 // re-initialization of some databases such as Thumbnails or Archived that |
| 792 // could fail. When these databases are not valid, our pointers must be NULL, | 801 // could fail. When these databases are not valid, our pointers must be NULL, |
| 793 // so we need to handle this type of operation to keep the pointers in sync. | 802 // so we need to handle this type of operation to keep the pointers in sync. |
| 794 void DeleteAllHistory(); | 803 void DeleteAllHistory(); |
| 795 | 804 |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 889 | 898 |
| 890 // Publishes the history to all indexers which are registered to receive | 899 // Publishes the history to all indexers which are registered to receive |
| 891 // history data from us. Can be NULL if there are no listeners. | 900 // history data from us. Can be NULL if there are no listeners. |
| 892 scoped_ptr<HistoryPublisher> history_publisher_; | 901 scoped_ptr<HistoryPublisher> history_publisher_; |
| 893 | 902 |
| 894 #if defined(OS_ANDROID) | 903 #if defined(OS_ANDROID) |
| 895 // Used to provide the Android ContentProvider APIs. | 904 // Used to provide the Android ContentProvider APIs. |
| 896 scoped_ptr<AndroidProviderBackend> android_provider_backend_; | 905 scoped_ptr<AndroidProviderBackend> android_provider_backend_; |
| 897 #endif | 906 #endif |
| 898 | 907 |
| 908 // Used to manage syncing of the typed urls datatype. This will be NULL |
| 909 // before Init is called. |
| 910 scoped_ptr<TypedUrlSyncableService> typed_url_syncable_service_; |
| 911 |
| 899 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); | 912 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); |
| 900 }; | 913 }; |
| 901 | 914 |
| 902 } // namespace history | 915 } // namespace history |
| 903 | 916 |
| 904 #endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ | 917 #endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ |
| OLD | NEW |