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_NOTIFICATIONS_SYNC_NOTIFIER_CHROME_NOTIFIER_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_SYNC_NOTIFIER_CHROME_NOTIFIER_SERVICE_H_ |
6 #define CHROME_BROWSER_NOTIFICATIONS_SYNC_NOTIFIER_CHROME_NOTIFIER_SERVICE_H_ | 6 #define CHROME_BROWSER_NOTIFICATIONS_SYNC_NOTIFIER_CHROME_NOTIFIER_SERVICE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/scoped_vector.h" | 11 #include "base/memory/scoped_vector.h" |
12 #include "base/threading/non_thread_safe.h" | 12 #include "base/threading/non_thread_safe.h" |
13 #include "chrome/browser/notifications/sync_notifier/synced_notification.h" | 13 #include "chrome/browser/notifications/sync_notifier/synced_notification.h" |
14 #include "components/browser_context_keyed_service/browser_context_keyed_service
.h" | 14 #include "components/browser_context_keyed_service/browser_context_keyed_service
.h" |
15 #include "sync/api/syncable_service.h" | 15 #include "sync/api/syncable_service.h" |
16 | 16 |
17 class NotificationUIManager; | 17 class NotificationUIManager; |
18 class Profile; | 18 class Profile; |
19 | 19 |
20 namespace notifier { | 20 namespace notifier { |
21 | 21 |
22 // The ChromeNotifierService holds notifications which represent the state of | 22 // The ChromeNotifierService holds notifications which represent the state of |
23 // delivered notifications for chrome. These are obtained from the sync service | 23 // delivered notifications for chrome. These are obtained from the sync service |
24 // and kept up to date. | 24 // and kept up to date. |
25 class ChromeNotifierService : public syncer::SyncableService, | 25 class ChromeNotifierService : public syncer::SyncableService, |
26 public ProfileKeyedService { | 26 public BrowserContextKeyedService { |
27 public: | 27 public: |
28 ChromeNotifierService(Profile* profile, NotificationUIManager* manager); | 28 ChromeNotifierService(Profile* profile, NotificationUIManager* manager); |
29 virtual ~ChromeNotifierService(); | 29 virtual ~ChromeNotifierService(); |
30 | 30 |
31 // Methods from ProfileKeyedService. | 31 // Methods from BrowserContextKeyedService. |
32 virtual void Shutdown() OVERRIDE; | 32 virtual void Shutdown() OVERRIDE; |
33 | 33 |
34 // syncer::SyncableService implementation. | 34 // syncer::SyncableService implementation. |
35 virtual syncer::SyncMergeResult MergeDataAndStartSyncing( | 35 virtual syncer::SyncMergeResult MergeDataAndStartSyncing( |
36 syncer::ModelType type, | 36 syncer::ModelType type, |
37 const syncer::SyncDataList& initial_sync_data, | 37 const syncer::SyncDataList& initial_sync_data, |
38 scoped_ptr<syncer::SyncChangeProcessor> sync_processor, | 38 scoped_ptr<syncer::SyncChangeProcessor> sync_processor, |
39 scoped_ptr<syncer::SyncErrorFactory> error_handler) OVERRIDE; | 39 scoped_ptr<syncer::SyncErrorFactory> error_handler) OVERRIDE; |
40 virtual void StopSyncing(syncer::ModelType type) OVERRIDE; | 40 virtual void StopSyncing(syncer::ModelType type) OVERRIDE; |
41 virtual syncer::SyncDataList GetAllSyncData( | 41 virtual syncer::SyncDataList GetAllSyncData( |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 // TODO(petewil): consider whether a map would better suit our data. | 79 // TODO(petewil): consider whether a map would better suit our data. |
80 // If there are many entries, lookup time may trump locality of reference. | 80 // If there are many entries, lookup time may trump locality of reference. |
81 ScopedVector<notifier::SyncedNotification> notification_data_; | 81 ScopedVector<notifier::SyncedNotification> notification_data_; |
82 | 82 |
83 DISALLOW_COPY_AND_ASSIGN(ChromeNotifierService); | 83 DISALLOW_COPY_AND_ASSIGN(ChromeNotifierService); |
84 }; | 84 }; |
85 | 85 |
86 } // namespace notifier | 86 } // namespace notifier |
87 | 87 |
88 #endif // CHROME_BROWSER_NOTIFICATIONS_SYNC_NOTIFIER_CHROME_NOTIFIER_SERVICE_H_ | 88 #endif // CHROME_BROWSER_NOTIFICATIONS_SYNC_NOTIFIER_CHROME_NOTIFIER_SERVICE_H_ |
OLD | NEW |