Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Side by Side Diff: chrome/browser/apps/ephemeral_app_service.cc

Issue 297263003: Optimize promotion of ephemeral apps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/apps/ephemeral_app_service.h ('k') | chrome/browser/apps/shortcut_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/apps/ephemeral_app_service.h ('k') | chrome/browser/apps/shortcut_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698