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 13 matching lines...) Expand all Loading... |
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 class TypedUrlSyncableService; |
32 struct ThumbnailScore; | 32 struct ThumbnailScore; |
33 | 33 |
| 34 namespace chrome { |
| 35 struct FaviconChangedDetails; |
| 36 } |
| 37 |
34 namespace history { | 38 namespace history { |
35 #if defined(OS_ANDROID) | 39 #if defined(OS_ANDROID) |
36 class AndroidProviderBackend; | 40 class AndroidProviderBackend; |
37 #endif | 41 #endif |
38 | 42 |
39 class CommitLaterTask; | 43 class CommitLaterTask; |
40 class HistoryPublisher; | 44 class HistoryPublisher; |
41 class VisitFilter; | 45 class VisitFilter; |
42 struct DownloadRow; | 46 struct DownloadRow; |
43 | 47 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 // thread. It is to be used on the main thread, so this would transfer | 84 // thread. It is to be used on the main thread, so this would transfer |
81 // it to the history service. Unit tests can override this behavior. | 85 // it to the history service. Unit tests can override this behavior. |
82 // | 86 // |
83 // This function is NOT guaranteed to be called. If there is an error, | 87 // This function is NOT guaranteed to be called. If there is an error, |
84 // there may be no in-memory database. | 88 // there may be no in-memory database. |
85 // | 89 // |
86 // Ownership of the backend pointer is transferred to this function. | 90 // Ownership of the backend pointer is transferred to this function. |
87 virtual void SetInMemoryBackend(int backend_id, | 91 virtual void SetInMemoryBackend(int backend_id, |
88 InMemoryHistoryBackend* backend) = 0; | 92 InMemoryHistoryBackend* backend) = 0; |
89 | 93 |
| 94 // Sends chrome::NOTIFICATION_FAVICON_CHANGED through Notification Serivce. |
| 95 // Ownership of the [details] is transferred to this function. |
| 96 virtual void SendFaviconChangedNotification( |
| 97 chrome::FaviconChangedDetails* details) = 0; |
| 98 |
90 // Broadcasts the specified notification to the notification service. | 99 // Broadcasts the specified notification to the notification service. |
91 // This is implemented here because notifications must only be sent from | 100 // This is implemented here because notifications must only be sent from |
92 // the main thread. This is the only method that doesn't identify the | 101 // the main thread. This is the only method that doesn't identify the |
93 // caller because notifications must always be sent. | 102 // caller because notifications must always be sent. |
94 // | 103 // |
95 // Ownership of the HistoryDetails is transferred to this function. | 104 // Ownership of the HistoryDetails is transferred to this function. |
96 virtual void BroadcastNotifications(int type, | 105 virtual void BroadcastNotifications(int type, |
97 HistoryDetails* details) = 0; | 106 HistoryDetails* details) = 0; |
98 | 107 |
99 // Invoked when the backend has finished loading the db. | 108 // Invoked when the backend has finished loading the db. |
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
776 | 785 |
777 // Generic stuff ------------------------------------------------------------- | 786 // Generic stuff ------------------------------------------------------------- |
778 | 787 |
779 // Processes the next scheduled HistoryDBTask, scheduling this method | 788 // Processes the next scheduled HistoryDBTask, scheduling this method |
780 // to be invoked again if there are more tasks that need to run. | 789 // to be invoked again if there are more tasks that need to run. |
781 void ProcessDBTaskImpl(); | 790 void ProcessDBTaskImpl(); |
782 | 791 |
783 // Release all tasks in history_db_tasks_ and clears it. | 792 // Release all tasks in history_db_tasks_ and clears it. |
784 void ReleaseDBTasks(); | 793 void ReleaseDBTasks(); |
785 | 794 |
| 795 // Sends a chrome::NOTIFICATION_FAVICON_CHANGED notification on the main |
| 796 // thread. |
| 797 void SendFaviconChangedNotification(chrome::FaviconChangedDetails* details); |
| 798 |
786 // Schedules a broadcast of the given notification on the main thread. The | 799 // Schedules a broadcast of the given notification on the main thread. The |
787 // details argument will have ownership taken by this function (it will be | 800 // details argument will have ownership taken by this function (it will be |
788 // sent to the main thread and deleted there). | 801 // sent to the main thread and deleted there). |
789 virtual void BroadcastNotifications(int type, | 802 virtual void BroadcastNotifications(int type, |
790 HistoryDetails* details_deleted) OVERRIDE; | 803 HistoryDetails* details_deleted) OVERRIDE; |
791 | 804 |
792 virtual void NotifySyncURLsDeleted(bool all_history, | 805 virtual void NotifySyncURLsDeleted(bool all_history, |
793 bool archived, | 806 bool archived, |
794 URLRows* rows) OVERRIDE; | 807 URLRows* rows) OVERRIDE; |
795 | 808 |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
909 // Used to manage syncing of the typed urls datatype. This will be NULL | 922 // Used to manage syncing of the typed urls datatype. This will be NULL |
910 // before Init is called. | 923 // before Init is called. |
911 scoped_ptr<TypedUrlSyncableService> typed_url_syncable_service_; | 924 scoped_ptr<TypedUrlSyncableService> typed_url_syncable_service_; |
912 | 925 |
913 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); | 926 DISALLOW_COPY_AND_ASSIGN(HistoryBackend); |
914 }; | 927 }; |
915 | 928 |
916 } // namespace history | 929 } // namespace history |
917 | 930 |
918 #endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ | 931 #endif // CHROME_BROWSER_HISTORY_HISTORY_BACKEND_H_ |
OLD | NEW |