| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 virtual SyncDataList GetAllSyncData(syncable::ModelType type) const OVERRIDE; | 66 virtual SyncDataList GetAllSyncData(syncable::ModelType type) const OVERRIDE; |
| 67 // Process notifications related changes from Sync, merging them into | 67 // Process notifications related changes from Sync, merging them into |
| 68 // our model. | 68 // our model. |
| 69 virtual SyncError ProcessSyncChanges( | 69 virtual SyncError ProcessSyncChanges( |
| 70 const tracked_objects::Location& from_here, | 70 const tracked_objects::Location& from_here, |
| 71 const SyncChangeList& change_list) OVERRIDE; | 71 const SyncChangeList& change_list) OVERRIDE; |
| 72 // Associate and merge sync data model with our data model. | 72 // Associate and merge sync data model with our data model. |
| 73 virtual SyncError MergeDataAndStartSyncing( | 73 virtual SyncError MergeDataAndStartSyncing( |
| 74 syncable::ModelType type, | 74 syncable::ModelType type, |
| 75 const SyncDataList& initial_sync_data, | 75 const SyncDataList& initial_sync_data, |
| 76 SyncChangeProcessor* sync_processor) OVERRIDE; | 76 scoped_ptr<SyncChangeProcessor> sync_processor) OVERRIDE; |
| 77 virtual void StopSyncing(syncable::ModelType type) OVERRIDE; | 77 virtual void StopSyncing(syncable::ModelType type) OVERRIDE; |
| 78 | 78 |
| 79 private: | 79 private: |
| 80 friend class AppNotificationManagerSyncTest; | 80 friend class AppNotificationManagerSyncTest; |
| 81 FRIEND_TEST_ALL_PREFIXES(AppNotificationManagerSyncTest, | 81 FRIEND_TEST_ALL_PREFIXES(AppNotificationManagerSyncTest, |
| 82 NotificationToSyncDataToNotification); | 82 NotificationToSyncDataToNotification); |
| 83 FRIEND_TEST_ALL_PREFIXES(AppNotificationManagerSyncTest, | 83 FRIEND_TEST_ALL_PREFIXES(AppNotificationManagerSyncTest, |
| 84 GetAllSyncDataNoLocal); | 84 GetAllSyncDataNoLocal); |
| 85 FRIEND_TEST_ALL_PREFIXES(AppNotificationManagerSyncTest, | 85 FRIEND_TEST_ALL_PREFIXES(AppNotificationManagerSyncTest, |
| 86 GetAllSyncDataSomeLocal); | 86 GetAllSyncDataSomeLocal); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 const SyncData& sync_data); | 148 const SyncData& sync_data); |
| 149 | 149 |
| 150 Profile* profile_; | 150 Profile* profile_; |
| 151 content::NotificationRegistrar registrar_; | 151 content::NotificationRegistrar registrar_; |
| 152 scoped_ptr<NotificationMap> notifications_; | 152 scoped_ptr<NotificationMap> notifications_; |
| 153 | 153 |
| 154 // This should only be used on the FILE thread. | 154 // This should only be used on the FILE thread. |
| 155 scoped_ptr<AppNotificationStorage> storage_; | 155 scoped_ptr<AppNotificationStorage> storage_; |
| 156 | 156 |
| 157 // Sync change processor we use to push all our changes. | 157 // Sync change processor we use to push all our changes. |
| 158 SyncChangeProcessor* sync_processor_; | 158 scoped_ptr<SyncChangeProcessor> sync_processor_; |
| 159 // Whether the sync model is associated with the local model. | 159 // Whether the sync model is associated with the local model. |
| 160 // In other words, whether we are ready to apply sync changes. | 160 // In other words, whether we are ready to apply sync changes. |
| 161 bool models_associated_; | 161 bool models_associated_; |
| 162 // Whether syncer changes are being processed right now. | 162 // Whether syncer changes are being processed right now. |
| 163 bool processing_syncer_changes_; | 163 bool processing_syncer_changes_; |
| 164 | 164 |
| 165 // Used for a histogram of load time. | 165 // Used for a histogram of load time. |
| 166 scoped_ptr<PerfTimer> load_timer_; | 166 scoped_ptr<PerfTimer> load_timer_; |
| 167 | 167 |
| 168 DISALLOW_COPY_AND_ASSIGN(AppNotificationManager); | 168 DISALLOW_COPY_AND_ASSIGN(AppNotificationManager); |
| 169 }; | 169 }; |
| 170 | 170 |
| 171 #endif // CHROME_BROWSER_EXTENSIONS_APP_NOTIFICATION_MANAGER_H_ | 171 #endif // CHROME_BROWSER_EXTENSIONS_APP_NOTIFICATION_MANAGER_H_ |
| OLD | NEW |