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_ANDROID_PROVIDER_CHROME_BROWSER_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_PROVIDER_CHROME_BROWSER_PROVIDER_H_ |
6 #define CHROME_BROWSER_ANDROID_PROVIDER_CHROME_BROWSER_PROVIDER_H_ | 6 #define CHROME_BROWSER_ANDROID_PROVIDER_CHROME_BROWSER_PROVIDER_H_ |
7 | 7 |
8 #include "base/android/jni_weak_ref.h" | 8 #include "base/android/jni_weak_ref.h" |
9 #include "base/android/scoped_java_ref.h" | 9 #include "base/android/scoped_java_ref.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/scoped_observer.h" | 11 #include "base/scoped_observer.h" |
12 #include "base/synchronization/waitable_event.h" | 12 #include "base/synchronization/waitable_event.h" |
13 #include "base/task/cancelable_task_tracker.h" | 13 #include "base/task/cancelable_task_tracker.h" |
14 #include "components/bookmarks/browser/base_bookmark_model_observer.h" | 14 #include "components/bookmarks/browser/base_bookmark_model_observer.h" |
15 #include "components/history/core/android/android_history_types.h" | 15 #include "components/history/core/android/android_history_types.h" |
16 #include "components/history/core/browser/history_service_observer.h" | 16 #include "components/history/core/browser/history_service_observer.h" |
17 #include "content/public/browser/notification_observer.h" | 17 #include "content/public/browser/notification_observer.h" |
18 #include "content/public/browser/notification_registrar.h" | 18 #include "content/public/browser/notification_registrar.h" |
19 | 19 |
20 class AndroidHistoryProviderService; | 20 class AndroidHistoryProviderService; |
21 class FaviconService; | 21 class FaviconService; |
22 class Profile; | 22 class Profile; |
23 | 23 |
24 namespace history { | 24 namespace history { |
25 class TopSites; | 25 class TopSitesProvider; |
26 } | 26 } |
27 | 27 |
28 namespace sql { | 28 namespace sql { |
29 class Statement; | 29 class Statement; |
30 } | 30 } |
31 | 31 |
32 // This class implements the native methods of ChromeBrowserProvider.java | 32 // This class implements the native methods of ChromeBrowserProvider.java |
33 class ChromeBrowserProvider : public bookmarks::BaseBookmarkModelObserver, | 33 class ChromeBrowserProvider : public bookmarks::BaseBookmarkModelObserver, |
34 public content::NotificationObserver, | 34 public content::NotificationObserver, |
35 public history::HistoryServiceObserver { | 35 public history::HistoryServiceObserver { |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 | 199 |
200 JavaObjectWeakGlobalRef weak_java_provider_; | 200 JavaObjectWeakGlobalRef weak_java_provider_; |
201 | 201 |
202 // Profile must outlive this object. | 202 // Profile must outlive this object. |
203 // | 203 // |
204 // BookmarkModel, HistoryService and history::TopSites lifetime is bound to | 204 // BookmarkModel, HistoryService and history::TopSites lifetime is bound to |
205 // the lifetime of Profile, they are safe to use as long as the Profile is | 205 // the lifetime of Profile, they are safe to use as long as the Profile is |
206 // alive. | 206 // alive. |
207 Profile* profile_; | 207 Profile* profile_; |
208 BookmarkModel* bookmark_model_; | 208 BookmarkModel* bookmark_model_; |
209 history::TopSites* top_sites_; | 209 history::TopSitesProvider* top_sites_provider_; |
210 FaviconService* favicon_service_; | 210 FaviconService* favicon_service_; |
211 | 211 |
212 scoped_ptr<AndroidHistoryProviderService> service_; | 212 scoped_ptr<AndroidHistoryProviderService> service_; |
213 | 213 |
214 base::CancelableTaskTracker cancelable_task_tracker_; | 214 base::CancelableTaskTracker cancelable_task_tracker_; |
215 | 215 |
216 // Used to register/unregister notification observer. | 216 // Used to register/unregister notification observer. |
217 content::NotificationRegistrar notification_registrar_; | 217 content::NotificationRegistrar notification_registrar_; |
218 ScopedObserver<HistoryService, HistoryServiceObserver> | 218 ScopedObserver<HistoryService, HistoryServiceObserver> |
219 history_service_observer_; | 219 history_service_observer_; |
220 | 220 |
221 bool handling_extensive_changes_; | 221 bool handling_extensive_changes_; |
222 | 222 |
223 DISALLOW_COPY_AND_ASSIGN(ChromeBrowserProvider); | 223 DISALLOW_COPY_AND_ASSIGN(ChromeBrowserProvider); |
224 }; | 224 }; |
225 | 225 |
226 #endif // CHROME_BROWSER_ANDROID_PROVIDER_CHROME_BROWSER_PROVIDER_H_ | 226 #endif // CHROME_BROWSER_ANDROID_PROVIDER_CHROME_BROWSER_PROVIDER_H_ |
OLD | NEW |