OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_APPS_EPHEMERAL_APP_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_APPS_EPHEMERAL_APP_SERVICE_H_ |
6 #define CHROME_BROWSER_APPS_EPHEMERAL_APP_SERVICE_H_ | 6 #define CHROME_BROWSER_APPS_EPHEMERAL_APP_SERVICE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 public content::NotificationObserver, | 27 public content::NotificationObserver, |
28 public extensions::ExtensionRegistryObserver { | 28 public extensions::ExtensionRegistryObserver { |
29 public: | 29 public: |
30 // Returns the instance for the given profile. This is a convenience wrapper | 30 // Returns the instance for the given profile. This is a convenience wrapper |
31 // around EphemeralAppServiceFactory::GetForProfile. | 31 // around EphemeralAppServiceFactory::GetForProfile. |
32 static EphemeralAppService* Get(Profile* profile); | 32 static EphemeralAppService* Get(Profile* profile); |
33 | 33 |
34 explicit EphemeralAppService(Profile* profile); | 34 explicit EphemeralAppService(Profile* profile); |
35 virtual ~EphemeralAppService(); | 35 virtual ~EphemeralAppService(); |
36 | 36 |
| 37 // Clears the ephemeral app cache. Removes all idle ephemeral apps. |
| 38 void ClearCachedApps(); |
| 39 |
37 int ephemeral_app_count() const { return ephemeral_app_count_; } | 40 int ephemeral_app_count() const { return ephemeral_app_count_; } |
38 | 41 |
39 // Constants exposed for testing purposes: | 42 // Constants exposed for testing purposes: |
40 | 43 |
41 // The number of days of inactivity before an ephemeral app will be removed. | 44 // The number of days of inactivity before an ephemeral app will be removed. |
42 static const int kAppInactiveThreshold; | 45 static const int kAppInactiveThreshold; |
43 // If the ephemeral app has been launched within this number of days, it will | 46 // If the ephemeral app has been launched within this number of days, it will |
44 // definitely not be garbage collected. | 47 // definitely not be garbage collected. |
45 static const int kAppKeepThreshold; | 48 static const int kAppKeepThreshold; |
46 // The maximum number of ephemeral apps to keep cached. Excess may be removed. | 49 // The maximum number of ephemeral apps to keep cached. Excess may be removed. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 // The count of cached ephemeral apps. | 91 // The count of cached ephemeral apps. |
89 int ephemeral_app_count_; | 92 int ephemeral_app_count_; |
90 | 93 |
91 friend class EphemeralAppServiceTest; | 94 friend class EphemeralAppServiceTest; |
92 friend class EphemeralAppServiceBrowserTest; | 95 friend class EphemeralAppServiceBrowserTest; |
93 | 96 |
94 DISALLOW_COPY_AND_ASSIGN(EphemeralAppService); | 97 DISALLOW_COPY_AND_ASSIGN(EphemeralAppService); |
95 }; | 98 }; |
96 | 99 |
97 #endif // CHROME_BROWSER_APPS_EPHEMERAL_APP_SERVICE_H_ | 100 #endif // CHROME_BROWSER_APPS_EPHEMERAL_APP_SERVICE_H_ |
OLD | NEW |