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 #include "chrome/browser/apps/ephemeral_app_service.h" | 5 #include "chrome/browser/apps/ephemeral_app_service.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/browser/apps/ephemeral_app_service_factory.h" | 8 #include "chrome/browser/apps/ephemeral_app_service_factory.h" |
9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
10 #include "chrome/browser/extensions/data_deleter.h" | 10 #include "chrome/browser/extensions/data_deleter.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 } | 95 } |
96 default: | 96 default: |
97 NOTREACHED(); | 97 NOTREACHED(); |
98 } | 98 } |
99 } | 99 } |
100 | 100 |
101 void EphemeralAppService::OnExtensionWillBeInstalled( | 101 void EphemeralAppService::OnExtensionWillBeInstalled( |
102 content::BrowserContext* browser_context, | 102 content::BrowserContext* browser_context, |
103 const extensions::Extension* extension, | 103 const extensions::Extension* extension, |
104 bool is_update, | 104 bool is_update, |
| 105 bool from_ephemeral, |
105 const std::string& old_name) { | 106 const std::string& old_name) { |
106 if (extensions::util::IsEphemeralApp(extension->id(), profile_)) { | 107 if (extensions::util::IsEphemeralApp(extension->id(), profile_)) { |
107 ++ephemeral_app_count_; | 108 ++ephemeral_app_count_; |
108 if (ephemeral_app_count_ >= kGarbageCollectAppsTriggerCount) | 109 if (ephemeral_app_count_ >= kGarbageCollectAppsTriggerCount) |
109 TriggerGarbageCollect( | 110 TriggerGarbageCollect( |
110 base::TimeDelta::FromSeconds(kGarbageCollectAppsInstallDelay)); | 111 base::TimeDelta::FromSeconds(kGarbageCollectAppsInstallDelay)); |
111 } | 112 } |
112 } | 113 } |
113 | 114 |
114 void EphemeralAppService::OnExtensionUninstalled( | 115 void EphemeralAppService::OnExtensionUninstalled( |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 info->extension_id, | 279 info->extension_id, |
279 &error)); | 280 &error)); |
280 | 281 |
281 if (extension.get()) | 282 if (extension.get()) |
282 extensions::DataDeleter::StartDeleting(profile_, extension.get()); | 283 extensions::DataDeleter::StartDeleting(profile_, extension.get()); |
283 } | 284 } |
284 | 285 |
285 prefs->RemoveEvictedEphemeralApp(info->extension_id); | 286 prefs->RemoveEvictedEphemeralApp(info->extension_id); |
286 } | 287 } |
287 } | 288 } |
OLD | NEW |