| 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_EXTENSIONS_APP_NOTIFICATION_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_APP_NOTIFICATION_MANAGER_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_APP_NOTIFICATION_MANAGER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_APP_NOTIFICATION_MANAGER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 virtual void Observe(int type, | 61 virtual void Observe(int type, |
| 62 const content::NotificationSource& source, | 62 const content::NotificationSource& source, |
| 63 const content::NotificationDetails& details) OVERRIDE; | 63 const content::NotificationDetails& details) OVERRIDE; |
| 64 | 64 |
| 65 bool loaded() const { return notifications_.get() != NULL; } | 65 bool loaded() const { return notifications_.get() != NULL; } |
| 66 | 66 |
| 67 // syncer::SyncableService implementation. | 67 // syncer::SyncableService implementation. |
| 68 | 68 |
| 69 // Returns all syncable notifications from this model as syncer::SyncData. | 69 // Returns all syncable notifications from this model as syncer::SyncData. |
| 70 virtual syncer::SyncDataList GetAllSyncData( | 70 virtual syncer::SyncDataList GetAllSyncData( |
| 71 syncable::ModelType type) const OVERRIDE; | 71 syncer::ModelType type) const OVERRIDE; |
| 72 // Process notifications related changes from Sync, merging them into | 72 // Process notifications related changes from Sync, merging them into |
| 73 // our model. | 73 // our model. |
| 74 virtual syncer::SyncError ProcessSyncChanges( | 74 virtual syncer::SyncError ProcessSyncChanges( |
| 75 const tracked_objects::Location& from_here, | 75 const tracked_objects::Location& from_here, |
| 76 const syncer::SyncChangeList& change_list) OVERRIDE; | 76 const syncer::SyncChangeList& change_list) OVERRIDE; |
| 77 // Associate and merge sync data model with our data model. | 77 // Associate and merge sync data model with our data model. |
| 78 virtual syncer::SyncError MergeDataAndStartSyncing( | 78 virtual syncer::SyncError MergeDataAndStartSyncing( |
| 79 syncable::ModelType type, | 79 syncer::ModelType type, |
| 80 const syncer::SyncDataList& initial_sync_data, | 80 const syncer::SyncDataList& initial_sync_data, |
| 81 scoped_ptr<syncer::SyncChangeProcessor> sync_processor, | 81 scoped_ptr<syncer::SyncChangeProcessor> sync_processor, |
| 82 scoped_ptr<syncer::SyncErrorFactory> sync_error_factory) OVERRIDE; | 82 scoped_ptr<syncer::SyncErrorFactory> sync_error_factory) OVERRIDE; |
| 83 virtual void StopSyncing(syncable::ModelType type) OVERRIDE; | 83 virtual void StopSyncing(syncer::ModelType type) OVERRIDE; |
| 84 | 84 |
| 85 private: | 85 private: |
| 86 friend class AppNotificationManagerSyncTest; | 86 friend class AppNotificationManagerSyncTest; |
| 87 friend class base::DeleteHelper<AppNotificationManager>; | 87 friend class base::DeleteHelper<AppNotificationManager>; |
| 88 friend struct content::BrowserThread::DeleteOnThread< | 88 friend struct content::BrowserThread::DeleteOnThread< |
| 89 content::BrowserThread::UI>; | 89 content::BrowserThread::UI>; |
| 90 FRIEND_TEST_ALL_PREFIXES(AppNotificationManagerSyncTest, | 90 FRIEND_TEST_ALL_PREFIXES(AppNotificationManagerSyncTest, |
| 91 NotificationToSyncDataToNotification); | 91 NotificationToSyncDataToNotification); |
| 92 FRIEND_TEST_ALL_PREFIXES(AppNotificationManagerSyncTest, | 92 FRIEND_TEST_ALL_PREFIXES(AppNotificationManagerSyncTest, |
| 93 GetAllSyncDataNoLocal); | 93 GetAllSyncDataNoLocal); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 // Whether syncer changes are being processed right now. | 175 // Whether syncer changes are being processed right now. |
| 176 bool processing_syncer_changes_; | 176 bool processing_syncer_changes_; |
| 177 | 177 |
| 178 // Used for a histogram of load time. | 178 // Used for a histogram of load time. |
| 179 scoped_ptr<PerfTimer> load_timer_; | 179 scoped_ptr<PerfTimer> load_timer_; |
| 180 | 180 |
| 181 DISALLOW_COPY_AND_ASSIGN(AppNotificationManager); | 181 DISALLOW_COPY_AND_ASSIGN(AppNotificationManager); |
| 182 }; | 182 }; |
| 183 | 183 |
| 184 #endif // CHROME_BROWSER_EXTENSIONS_APP_NOTIFICATION_MANAGER_H_ | 184 #endif // CHROME_BROWSER_EXTENSIONS_APP_NOTIFICATION_MANAGER_H_ |
| OLD | NEW |