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_API_ALARMS_ALARM_MANAGER_H__ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_ALARMS_ALARM_MANAGER_H__ |
6 #define CHROME_BROWSER_EXTENSIONS_API_ALARMS_ALARM_MANAGER_H__ | 6 #define CHROME_BROWSER_EXTENSIONS_API_ALARMS_ALARM_MANAGER_H__ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <queue> | 9 #include <queue> |
10 #include <string> | 10 #include <string> |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 // Polls the alarms, running any that have elapsed. After running them and | 196 // Polls the alarms, running any that have elapsed. After running them and |
197 // rescheduling repeating alarms, schedule the next poll. | 197 // rescheduling repeating alarms, schedule the next poll. |
198 void PollAlarms(); | 198 void PollAlarms(); |
199 | 199 |
200 // Executes |action| for given extension, making sure that the extension's | 200 // Executes |action| for given extension, making sure that the extension's |
201 // alarm data has been synced from the storage. | 201 // alarm data has been synced from the storage. |
202 void RunWhenReady(const std::string& extension_id, const ReadyAction& action); | 202 void RunWhenReady(const std::string& extension_id, const ReadyAction& action); |
203 | 203 |
204 // ExtensionRegistryObserver implementation. | 204 // ExtensionRegistryObserver implementation. |
205 virtual void OnExtensionLoaded(content::BrowserContext* browser_context, | 205 virtual void OnExtensionLoaded(content::BrowserContext* browser_context, |
206 const Extension* extension) OVERRIDE; | 206 const Extension* extension) override; |
207 virtual void OnExtensionUninstalled( | 207 virtual void OnExtensionUninstalled( |
208 content::BrowserContext* browser_context, | 208 content::BrowserContext* browser_context, |
209 const Extension* extension, | 209 const Extension* extension, |
210 extensions::UninstallReason reason) OVERRIDE; | 210 extensions::UninstallReason reason) override; |
211 | 211 |
212 // BrowserContextKeyedAPI implementation. | 212 // BrowserContextKeyedAPI implementation. |
213 static const char* service_name() { | 213 static const char* service_name() { |
214 return "AlarmManager"; | 214 return "AlarmManager"; |
215 } | 215 } |
216 static const bool kServiceHasOwnInstanceInIncognito = true; | 216 static const bool kServiceHasOwnInstanceInIncognito = true; |
217 | 217 |
218 content::BrowserContext* const browser_context_; | 218 content::BrowserContext* const browser_context_; |
219 scoped_ptr<base::Clock> clock_; | 219 scoped_ptr<base::Clock> clock_; |
220 scoped_ptr<Delegate> delegate_; | 220 scoped_ptr<Delegate> delegate_; |
(...skipping 18 matching lines...) Expand all Loading... |
239 | 239 |
240 // Next poll's time. | 240 // Next poll's time. |
241 base::Time next_poll_time_; | 241 base::Time next_poll_time_; |
242 | 242 |
243 DISALLOW_COPY_AND_ASSIGN(AlarmManager); | 243 DISALLOW_COPY_AND_ASSIGN(AlarmManager); |
244 }; | 244 }; |
245 | 245 |
246 } // namespace extensions | 246 } // namespace extensions |
247 | 247 |
248 #endif // CHROME_BROWSER_EXTENSIONS_API_ALARMS_ALARM_MANAGER_H__ | 248 #endif // CHROME_BROWSER_EXTENSIONS_API_ALARMS_ALARM_MANAGER_H__ |
OLD | NEW |