| 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 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 StopSyncing); | 112 StopSyncing); |
| 113 FRIEND_TEST_ALL_PREFIXES(AppNotificationManagerSyncTest, | 113 FRIEND_TEST_ALL_PREFIXES(AppNotificationManagerSyncTest, |
| 114 ClearAllGetsSynced); | 114 ClearAllGetsSynced); |
| 115 | 115 |
| 116 // Maps extension id to a list of notifications for that extension. | 116 // Maps extension id to a list of notifications for that extension. |
| 117 typedef std::map<std::string, AppNotificationList> NotificationMap; | 117 typedef std::map<std::string, AppNotificationList> NotificationMap; |
| 118 | 118 |
| 119 virtual ~AppNotificationManager(); | 119 virtual ~AppNotificationManager(); |
| 120 | 120 |
| 121 // Starts loading storage_ using |storage_path|. | 121 // Starts loading storage_ using |storage_path|. |
| 122 void LoadOnFileThread(const FilePath& storage_path); | 122 void LoadOnFileThread(const base::FilePath& storage_path); |
| 123 | 123 |
| 124 // Called on the UI thread to handle the loaded results from storage_. | 124 // Called on the UI thread to handle the loaded results from storage_. |
| 125 void HandleLoadResults(NotificationMap* map); | 125 void HandleLoadResults(NotificationMap* map); |
| 126 | 126 |
| 127 // Saves the contents of |list| to storage. | 127 // Saves the contents of |list| to storage. |
| 128 // Ownership of |list| is transferred here. | 128 // Ownership of |list| is transferred here. |
| 129 void SaveOnFileThread(const std::string& extension_id, | 129 void SaveOnFileThread(const std::string& extension_id, |
| 130 AppNotificationList* list); | 130 AppNotificationList* list); |
| 131 | 131 |
| 132 void DeleteOnFileThread(const std::string& extension_id); | 132 void DeleteOnFileThread(const std::string& extension_id); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 | 178 |
| 179 // Used for a histogram of load time. | 179 // Used for a histogram of load time. |
| 180 scoped_ptr<PerfTimer> load_timer_; | 180 scoped_ptr<PerfTimer> load_timer_; |
| 181 | 181 |
| 182 DISALLOW_COPY_AND_ASSIGN(AppNotificationManager); | 182 DISALLOW_COPY_AND_ASSIGN(AppNotificationManager); |
| 183 }; | 183 }; |
| 184 | 184 |
| 185 } // namespace extensions | 185 } // namespace extensions |
| 186 | 186 |
| 187 #endif // CHROME_BROWSER_EXTENSIONS_APP_NOTIFICATION_MANAGER_H_ | 187 #endif // CHROME_BROWSER_EXTENSIONS_APP_NOTIFICATION_MANAGER_H_ |
| OLD | NEW |