| 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 APPS_APP_RESTORE_SERVICE_H_ | 5 #ifndef APPS_APP_RESTORE_SERVICE_H_ |
| 6 #define APPS_APP_RESTORE_SERVICE_H_ | 6 #define APPS_APP_RESTORE_SERVICE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 void HandleStartup(bool should_restore_apps); | 35 void HandleStartup(bool should_restore_apps); |
| 36 | 36 |
| 37 // Returns whether this extension is running or, at startup, whether it was | 37 // Returns whether this extension is running or, at startup, whether it was |
| 38 // running when Chrome was last terminated. | 38 // running when Chrome was last terminated. |
| 39 bool IsAppRestorable(const std::string& extension_id); | 39 bool IsAppRestorable(const std::string& extension_id); |
| 40 | 40 |
| 41 static AppRestoreService* Get(Profile* profile); | 41 static AppRestoreService* Get(Profile* profile); |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 // AppLifetimeMonitor::Observer. | 44 // AppLifetimeMonitor::Observer. |
| 45 virtual void OnAppStart(Profile* profile, const std::string& app_id) OVERRIDE; | 45 virtual void OnAppStart(Profile* profile, const std::string& app_id) override; |
| 46 virtual void OnAppActivated(Profile* profile, | 46 virtual void OnAppActivated(Profile* profile, |
| 47 const std::string& app_id) OVERRIDE; | 47 const std::string& app_id) override; |
| 48 virtual void OnAppDeactivated(Profile* profile, | 48 virtual void OnAppDeactivated(Profile* profile, |
| 49 const std::string& app_id) OVERRIDE; | 49 const std::string& app_id) override; |
| 50 virtual void OnAppStop(Profile* profile, const std::string& app_id) OVERRIDE; | 50 virtual void OnAppStop(Profile* profile, const std::string& app_id) override; |
| 51 virtual void OnChromeTerminating() OVERRIDE; | 51 virtual void OnChromeTerminating() override; |
| 52 | 52 |
| 53 // KeyedService. | 53 // KeyedService. |
| 54 virtual void Shutdown() OVERRIDE; | 54 virtual void Shutdown() override; |
| 55 | 55 |
| 56 void RecordAppStart(const std::string& extension_id); | 56 void RecordAppStart(const std::string& extension_id); |
| 57 void RecordAppStop(const std::string& extension_id); | 57 void RecordAppStop(const std::string& extension_id); |
| 58 void RecordAppActiveState(const std::string& id, bool is_active); | 58 void RecordAppActiveState(const std::string& id, bool is_active); |
| 59 | 59 |
| 60 void RestoreApp(const extensions::Extension* extension); | 60 void RestoreApp(const extensions::Extension* extension); |
| 61 | 61 |
| 62 void StartObservingAppLifetime(); | 62 void StartObservingAppLifetime(); |
| 63 void StopObservingAppLifetime(); | 63 void StopObservingAppLifetime(); |
| 64 | 64 |
| 65 Profile* profile_; | 65 Profile* profile_; |
| 66 | 66 |
| 67 DISALLOW_COPY_AND_ASSIGN(AppRestoreService); | 67 DISALLOW_COPY_AND_ASSIGN(AppRestoreService); |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 } // namespace apps | 70 } // namespace apps |
| 71 | 71 |
| 72 #endif // APPS_APP_RESTORE_SERVICE_H_ | 72 #endif // APPS_APP_RESTORE_SERVICE_H_ |
| OLD | NEW |