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 <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/bind.h" | 13 #include "base/bind.h" |
14 #include "base/callback.h" | 14 #include "base/callback.h" |
15 #include "base/callback_list.h" | 15 #include "base/callback_list.h" |
16 #include "base/files/file_path.h" | 16 #include "base/files/file_path.h" |
17 #include "base/logging.h" | 17 #include "base/logging.h" |
18 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
19 #include "base/memory/scoped_ptr.h" | 19 #include "base/memory/scoped_ptr.h" |
20 #include "base/memory/weak_ptr.h" | 20 #include "base/memory/weak_ptr.h" |
21 #include "base/observer_list.h" | 21 #include "base/observer_list.h" |
22 #include "base/strings/string16.h" | 22 #include "base/strings/string16.h" |
23 #include "base/task/cancelable_task_tracker.h" | 23 #include "base/task/cancelable_task_tracker.h" |
24 #include "base/threading/thread_checker.h" | 24 #include "base/threading/thread_checker.h" |
25 #include "base/time/time.h" | 25 #include "base/time/time.h" |
26 #include "chrome/browser/history/delete_directive_handler.h" | 26 #include "chrome/browser/history/delete_directive_handler.h" |
27 #include "chrome/browser/history/typed_url_syncable_service.h" | 27 #include "chrome/browser/history/typed_url_syncable_service.h" |
28 #include "components/favicon_base/favicon_callback.h" | 28 #include "components/favicon_base/favicon_callback.h" |
29 #include "components/favicon_base/favicon_usage_data.h" | 29 #include "components/favicon_base/favicon_usage_data.h" |
30 #include "components/history/core/browser/history_client.h" | |
31 #include "components/history/core/browser/keyword_id.h" | 30 #include "components/history/core/browser/keyword_id.h" |
32 #include "components/keyed_service/core/keyed_service.h" | 31 #include "components/keyed_service/core/keyed_service.h" |
33 #include "components/visitedlink/browser/visitedlink_delegate.h" | 32 #include "components/visitedlink/browser/visitedlink_delegate.h" |
34 #include "sql/init_status.h" | 33 #include "sql/init_status.h" |
35 #include "sync/api/syncable_service.h" | 34 #include "sync/api/syncable_service.h" |
36 #include "ui/base/page_transition_types.h" | 35 #include "ui/base/page_transition_types.h" |
37 | 36 |
38 #if defined(OS_ANDROID) | 37 #if defined(OS_ANDROID) |
39 class AndroidHistoryProviderService; | 38 class AndroidHistoryProviderService; |
40 #endif | 39 #endif |
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 history::VisitSource visit_source); | 495 history::VisitSource visit_source); |
497 | 496 |
498 // The same as AddPageWithDetails() but takes a vector. | 497 // The same as AddPageWithDetails() but takes a vector. |
499 void AddPagesWithDetails(const history::URLRows& info, | 498 void AddPagesWithDetails(const history::URLRows& info, |
500 history::VisitSource visit_source); | 499 history::VisitSource visit_source); |
501 | 500 |
502 // Returns true if this looks like the type of URL we want to add to the | 501 // Returns true if this looks like the type of URL we want to add to the |
503 // history. We filter out some URLs such as JavaScript. | 502 // history. We filter out some URLs such as JavaScript. |
504 static bool CanAddURL(const GURL& url); | 503 static bool CanAddURL(const GURL& url); |
505 | 504 |
506 // Returns the HistoryClient. | |
507 history::HistoryClient* history_client() { return history_client_; } | |
508 | |
509 base::WeakPtr<HistoryService> AsWeakPtr(); | 505 base::WeakPtr<HistoryService> AsWeakPtr(); |
510 | 506 |
511 // syncer::SyncableService implementation. | 507 // syncer::SyncableService implementation. |
512 syncer::SyncMergeResult MergeDataAndStartSyncing( | 508 syncer::SyncMergeResult MergeDataAndStartSyncing( |
513 syncer::ModelType type, | 509 syncer::ModelType type, |
514 const syncer::SyncDataList& initial_sync_data, | 510 const syncer::SyncDataList& initial_sync_data, |
515 scoped_ptr<syncer::SyncChangeProcessor> sync_processor, | 511 scoped_ptr<syncer::SyncChangeProcessor> sync_processor, |
516 scoped_ptr<syncer::SyncErrorFactory> error_handler) override; | 512 scoped_ptr<syncer::SyncErrorFactory> error_handler) override; |
517 void StopSyncing(syncer::ModelType type) override; | 513 void StopSyncing(syncer::ModelType type) override; |
518 syncer::SyncDataList GetAllSyncData(syncer::ModelType type) const override; | 514 syncer::SyncDataList GetAllSyncData(syncer::ModelType type) const override; |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
843 | 839 |
844 history::DeleteDirectiveHandler delete_directive_handler_; | 840 history::DeleteDirectiveHandler delete_directive_handler_; |
845 | 841 |
846 // All vended weak pointers are invalidated in Cleanup(). | 842 // All vended weak pointers are invalidated in Cleanup(). |
847 base::WeakPtrFactory<HistoryService> weak_ptr_factory_; | 843 base::WeakPtrFactory<HistoryService> weak_ptr_factory_; |
848 | 844 |
849 DISALLOW_COPY_AND_ASSIGN(HistoryService); | 845 DISALLOW_COPY_AND_ASSIGN(HistoryService); |
850 }; | 846 }; |
851 | 847 |
852 #endif // CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ | 848 #endif // CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ |
OLD | NEW |