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

Side by Side Diff: chrome/browser/extensions/extension_service.cc

Issue 397903002: Do not assign launch ordinals to ephemeral apps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ephemapp_unload_review
Patch Set: Created 6 years, 5 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/extensions/extension_service.h" 5 #include "chrome/browser/extensions/extension_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 #include <set> 9 #include <set>
10 10
(...skipping 1827 matching lines...) Expand 10 before | Expand all | Expand 10 after
1838 // was not available. 1838 // was not available.
1839 if (SharedModuleInfo::IsSharedModule(extension)) 1839 if (SharedModuleInfo::IsSharedModule(extension))
1840 MaybeFinishDelayedInstallations(); 1840 MaybeFinishDelayedInstallations();
1841 } 1841 }
1842 1842
1843 void ExtensionService::PromoteEphemeralApp( 1843 void ExtensionService::PromoteEphemeralApp(
1844 const extensions::Extension* extension, bool is_from_sync) { 1844 const extensions::Extension* extension, bool is_from_sync) {
1845 DCHECK(GetInstalledExtension(extension->id()) && 1845 DCHECK(GetInstalledExtension(extension->id()) &&
1846 extension_prefs_->IsEphemeralApp(extension->id())); 1846 extension_prefs_->IsEphemeralApp(extension->id()));
1847 1847
1848 // Remove the ephemeral flags from the preferences.
1849 extension_prefs_->OnEphemeralAppPromoted(extension->id());
1850
1848 if (!is_from_sync) { 1851 if (!is_from_sync) {
1849 if (extension->RequiresSortOrdinal()) { 1852 if (extension->RequiresSortOrdinal()) {
1850 // Reset the sort ordinals of the app to ensure it is added to the default 1853 // Reset the sort ordinals of the app to ensure it is added to the default
1851 // position, like newly installed apps would. 1854 // position, like newly installed apps would.
1852 extension_prefs_->app_sorting()->ClearOrdinals(extension->id()); 1855 extension_prefs_->app_sorting()->ClearOrdinals(extension->id());
1853 extension_prefs_->app_sorting()->EnsureValidOrdinals( 1856 extension_prefs_->app_sorting()->EnsureValidOrdinals(
1854 extension->id(), syncer::StringOrdinal()); 1857 extension->id(), syncer::StringOrdinal());
1855 } 1858 }
1856 } 1859 }
1857 1860
1858 // Remove the ephemeral flags from the preferences.
1859 extension_prefs_->OnEphemeralAppPromoted(extension->id());
1860
1861 // Fire install-related events to allow observers to handle the promotion 1861 // Fire install-related events to allow observers to handle the promotion
1862 // of the ephemeral app. 1862 // of the ephemeral app.
1863 extensions::InstalledExtensionInfo details( 1863 extensions::InstalledExtensionInfo details(
1864 extension, 1864 extension,
1865 true /* is update */, 1865 true /* is update */,
1866 true /* from ephemeral */, 1866 true /* from ephemeral */,
1867 extension->name() /* old name */); 1867 extension->name() /* old name */);
1868 content::NotificationService::current()->Notify( 1868 content::NotificationService::current()->Notify(
1869 chrome::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED, 1869 chrome::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED,
1870 content::Source<Profile>(profile_), 1870 content::Source<Profile>(profile_),
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
2375 } 2375 }
2376 2376
2377 void ExtensionService::OnProfileDestructionStarted() { 2377 void ExtensionService::OnProfileDestructionStarted() {
2378 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); 2378 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs();
2379 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); 2379 for (ExtensionIdSet::iterator it = ids_to_unload.begin();
2380 it != ids_to_unload.end(); 2380 it != ids_to_unload.end();
2381 ++it) { 2381 ++it) {
2382 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); 2382 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN);
2383 } 2383 }
2384 } 2384 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698