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_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ |
6 #define CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ | 6 #define CHROME_BROWSER_HISTORY_HISTORY_SERVICE_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/bind.h" |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
15 #include "base/logging.h" | 15 #include "base/logging.h" |
16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
18 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
19 #include "base/observer_list.h" | 19 #include "base/observer_list.h" |
20 #include "base/strings/string16.h" | 20 #include "base/strings/string16.h" |
21 #include "base/task/cancelable_task_tracker.h" | 21 #include "base/task/cancelable_task_tracker.h" |
22 #include "base/threading/thread_checker.h" | 22 #include "base/threading/thread_checker.h" |
23 #include "base/time/time.h" | 23 #include "base/time/time.h" |
24 #include "chrome/browser/history/delete_directive_handler.h" | 24 #include "chrome/browser/history/delete_directive_handler.h" |
25 #include "chrome/browser/history/typed_url_syncable_service.h" | 25 #include "chrome/browser/history/typed_url_syncable_service.h" |
26 #include "chrome/common/ref_counted_util.h" | 26 #include "chrome/common/ref_counted_util.h" |
27 #include "components/favicon_base/favicon_callback.h" | 27 #include "components/favicon_base/favicon_callback.h" |
28 #include "components/history/core/browser/history_client.h" | 28 #include "components/history/core/browser/history_client.h" |
29 #include "components/history/core/browser/history_service_observer.h" | |
29 #include "components/history/core/browser/keyword_id.h" | 30 #include "components/history/core/browser/keyword_id.h" |
30 #include "components/keyed_service/core/keyed_service.h" | 31 #include "components/keyed_service/core/keyed_service.h" |
31 #include "components/visitedlink/browser/visitedlink_delegate.h" | 32 #include "components/visitedlink/browser/visitedlink_delegate.h" |
32 #include "content/public/browser/download_manager_delegate.h" | 33 #include "content/public/browser/download_manager_delegate.h" |
33 #include "content/public/browser/notification_observer.h" | 34 #include "content/public/browser/notification_observer.h" |
34 #include "content/public/browser/notification_registrar.h" | 35 #include "content/public/browser/notification_registrar.h" |
35 #include "content/public/common/page_transition_types.h" | 36 #include "content/public/common/page_transition_types.h" |
36 #include "sql/init_status.h" | 37 #include "sql/init_status.h" |
37 #include "sync/api/syncable_service.h" | 38 #include "sync/api/syncable_service.h" |
38 | 39 |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
505 const syncer::SyncDataList& initial_sync_data, | 506 const syncer::SyncDataList& initial_sync_data, |
506 scoped_ptr<syncer::SyncChangeProcessor> sync_processor, | 507 scoped_ptr<syncer::SyncChangeProcessor> sync_processor, |
507 scoped_ptr<syncer::SyncErrorFactory> error_handler) OVERRIDE; | 508 scoped_ptr<syncer::SyncErrorFactory> error_handler) OVERRIDE; |
508 virtual void StopSyncing(syncer::ModelType type) OVERRIDE; | 509 virtual void StopSyncing(syncer::ModelType type) OVERRIDE; |
509 virtual syncer::SyncDataList GetAllSyncData( | 510 virtual syncer::SyncDataList GetAllSyncData( |
510 syncer::ModelType type) const OVERRIDE; | 511 syncer::ModelType type) const OVERRIDE; |
511 virtual syncer::SyncError ProcessSyncChanges( | 512 virtual syncer::SyncError ProcessSyncChanges( |
512 const tracked_objects::Location& from_here, | 513 const tracked_objects::Location& from_here, |
513 const syncer::SyncChangeList& change_list) OVERRIDE; | 514 const syncer::SyncChangeList& change_list) OVERRIDE; |
514 | 515 |
516 // Adds or removes observers for the HistoryServiceObserver. | |
517 void AddHistoryServiceObserver(history::HistoryServiceObserver* observer); | |
518 void RemoveHistoryServiceObserver(history::HistoryServiceObserver* observer); | |
519 // Called to Notify the HistoryService is loaded. | |
520 void NotifyHistoryServiceLoaded(); | |
521 // Returns Profile that the history service belongs to. | |
522 Profile* profile() { return profile_; } | |
sdefresne
2014/09/23 08:45:09
We'll have to remove this method later. Can you ma
nshaik
2014/10/29 08:43:39
Done.
| |
523 | |
515 protected: | 524 protected: |
516 // These are not currently used, hopefully we can do something in the future | 525 // These are not currently used, hopefully we can do something in the future |
517 // to ensure that the most important things happen first. | 526 // to ensure that the most important things happen first. |
518 enum SchedulePriority { | 527 enum SchedulePriority { |
519 PRIORITY_UI, // The highest priority (must respond to UI events). | 528 PRIORITY_UI, // The highest priority (must respond to UI events). |
520 PRIORITY_NORMAL, // Normal stuff like adding a page. | 529 PRIORITY_NORMAL, // Normal stuff like adding a page. |
521 PRIORITY_LOW, // Low priority things like indexing or expiration. | 530 PRIORITY_LOW, // Low priority things like indexing or expiration. |
522 }; | 531 }; |
523 | 532 |
524 private: | 533 private: |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
861 | 870 |
862 // The index used for quick history lookups. | 871 // The index used for quick history lookups. |
863 // TODO(mrossetti): Move in_memory_url_index out of history_service. | 872 // TODO(mrossetti): Move in_memory_url_index out of history_service. |
864 // See http://crbug.com/138321 | 873 // See http://crbug.com/138321 |
865 scoped_ptr<history::InMemoryURLIndex> in_memory_url_index_; | 874 scoped_ptr<history::InMemoryURLIndex> in_memory_url_index_; |
866 | 875 |
867 ObserverList<history::VisitDatabaseObserver> visit_database_observers_; | 876 ObserverList<history::VisitDatabaseObserver> visit_database_observers_; |
868 | 877 |
869 history::DeleteDirectiveHandler delete_directive_handler_; | 878 history::DeleteDirectiveHandler delete_directive_handler_; |
870 | 879 |
880 ObserverList<history::HistoryServiceObserver> history_service_observers_; | |
881 | |
871 DISALLOW_COPY_AND_ASSIGN(HistoryService); | 882 DISALLOW_COPY_AND_ASSIGN(HistoryService); |
872 }; | 883 }; |
873 | 884 |
874 #endif // CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ | 885 #endif // CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ |
OLD | NEW |