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_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_HISTORY_H_ |
6 #define CHROME_BROWSER_HISTORY_HISTORY_H_ | 6 #define CHROME_BROWSER_HISTORY_HISTORY_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/bind.h" |
12 #include "base/callback.h" | 13 #include "base/callback.h" |
13 #include "base/file_path.h" | 14 #include "base/file_path.h" |
| 15 #include "base/logging.h" |
14 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
15 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
16 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
17 #include "base/observer_list.h" | 19 #include "base/observer_list.h" |
18 #include "base/string16.h" | 20 #include "base/string16.h" |
19 #include "base/time.h" | 21 #include "base/time.h" |
20 #include "base/threading/thread_checker.h" | 22 #include "base/threading/thread_checker.h" |
21 #include "chrome/browser/common/cancelable_request.h" | 23 #include "chrome/browser/common/cancelable_request.h" |
22 #include "chrome/browser/favicon/favicon_service.h" | 24 #include "chrome/browser/favicon/favicon_service.h" |
23 #include "chrome/browser/history/history_types.h" | 25 #include "chrome/browser/history/history_types.h" |
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 // Called by TopSites after the thumbnails were read and it is safe | 619 // Called by TopSites after the thumbnails were read and it is safe |
618 // to delete the thumbnails DB. | 620 // to delete the thumbnails DB. |
619 void OnTopSitesReady(); | 621 void OnTopSitesReady(); |
620 | 622 |
621 // Returns true if this looks like the type of URL we want to add to the | 623 // Returns true if this looks like the type of URL we want to add to the |
622 // history. We filter out some URLs such as JavaScript. | 624 // history. We filter out some URLs such as JavaScript. |
623 static bool CanAddURL(const GURL& url); | 625 static bool CanAddURL(const GURL& url); |
624 | 626 |
625 base::WeakPtr<HistoryService> AsWeakPtr(); | 627 base::WeakPtr<HistoryService> AsWeakPtr(); |
626 | 628 |
| 629 void ProcessDeleteDirectiveForTest( |
| 630 const sync_pb::HistoryDeleteDirectiveSpecifics& delete_directive); |
| 631 |
627 // syncer::SyncableService implementation. | 632 // syncer::SyncableService implementation. |
628 virtual syncer::SyncMergeResult MergeDataAndStartSyncing( | 633 virtual syncer::SyncMergeResult MergeDataAndStartSyncing( |
629 syncer::ModelType type, | 634 syncer::ModelType type, |
630 const syncer::SyncDataList& initial_sync_data, | 635 const syncer::SyncDataList& initial_sync_data, |
631 scoped_ptr<syncer::SyncChangeProcessor> sync_processor, | 636 scoped_ptr<syncer::SyncChangeProcessor> sync_processor, |
632 scoped_ptr<syncer::SyncErrorFactory> error_handler) OVERRIDE; | 637 scoped_ptr<syncer::SyncErrorFactory> error_handler) OVERRIDE; |
633 virtual void StopSyncing(syncer::ModelType type) OVERRIDE; | 638 virtual void StopSyncing(syncer::ModelType type) OVERRIDE; |
634 virtual syncer::SyncDataList GetAllSyncData( | 639 virtual syncer::SyncDataList GetAllSyncData( |
635 syncer::ModelType type) const OVERRIDE; | 640 syncer::ModelType type) const OVERRIDE; |
636 virtual syncer::SyncError ProcessSyncChanges( | 641 virtual syncer::SyncError ProcessSyncChanges( |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 | 854 |
850 // Call to schedule a given task for running on the history thread with the | 855 // Call to schedule a given task for running on the history thread with the |
851 // specified priority. The task will have ownership taken. | 856 // specified priority. The task will have ownership taken. |
852 void ScheduleTask(SchedulePriority priority, const base::Closure& task); | 857 void ScheduleTask(SchedulePriority priority, const base::Closure& task); |
853 | 858 |
854 // Delete local history according to the given directive (from | 859 // Delete local history according to the given directive (from |
855 // sync). | 860 // sync). |
856 void ProcessDeleteDirective( | 861 void ProcessDeleteDirective( |
857 const sync_pb::HistoryDeleteDirectiveSpecifics& delete_directive); | 862 const sync_pb::HistoryDeleteDirectiveSpecifics& delete_directive); |
858 | 863 |
| 864 // Called when a delete directive has been processed. |
| 865 void OnDeleteDirectiveProcessed( |
| 866 const sync_pb::HistoryDeleteDirectiveSpecifics& delete_directive); |
| 867 |
859 // Schedule ------------------------------------------------------------------ | 868 // Schedule ------------------------------------------------------------------ |
860 // | 869 // |
861 // Functions for scheduling operations on the history thread that have a | 870 // Functions for scheduling operations on the history thread that have a |
862 // handle and may be cancelable. For fire-and-forget operations, see | 871 // handle and may be cancelable. For fire-and-forget operations, see |
863 // ScheduleAndForget below. | 872 // ScheduleAndForget below. |
864 | 873 |
865 template<typename BackendFunc, class RequestType> | 874 template<typename BackendFunc, class RequestType> |
866 Handle Schedule(SchedulePriority priority, | 875 Handle Schedule(SchedulePriority priority, |
867 BackendFunc func, // Function to call on the HistoryBackend. | 876 BackendFunc func, // Function to call on the HistoryBackend. |
868 CancelableRequestConsumerBase* consumer, | 877 CancelableRequestConsumerBase* consumer, |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1129 // TODO(mrossetti): Move in_memory_url_index out of history_service. | 1138 // TODO(mrossetti): Move in_memory_url_index out of history_service. |
1130 // See http://crbug.com/138321 | 1139 // See http://crbug.com/138321 |
1131 scoped_ptr<history::InMemoryURLIndex> in_memory_url_index_; | 1140 scoped_ptr<history::InMemoryURLIndex> in_memory_url_index_; |
1132 | 1141 |
1133 ObserverList<history::VisitDatabaseObserver> visit_database_observers_; | 1142 ObserverList<history::VisitDatabaseObserver> visit_database_observers_; |
1134 | 1143 |
1135 DISALLOW_COPY_AND_ASSIGN(HistoryService); | 1144 DISALLOW_COPY_AND_ASSIGN(HistoryService); |
1136 }; | 1145 }; |
1137 | 1146 |
1138 #endif // CHROME_BROWSER_HISTORY_HISTORY_H_ | 1147 #endif // CHROME_BROWSER_HISTORY_HISTORY_H_ |
OLD | NEW |