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

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

Issue 386033002: Prune shared extendion module after extension updating. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix review issues 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 | Annotate | Revision Log
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 1798 matching lines...) Expand 10 before | Expand all | Expand 10 after
1809 // Unpacked extensions default to allowing file access, but if that has been 1809 // Unpacked extensions default to allowing file access, but if that has been
1810 // overridden, don't reset the value. 1810 // overridden, don't reset the value.
1811 if (Manifest::ShouldAlwaysAllowFileAccess(extension->location()) && 1811 if (Manifest::ShouldAlwaysAllowFileAccess(extension->location()) &&
1812 !extension_prefs_->HasAllowFileAccessSetting(extension->id())) { 1812 !extension_prefs_->HasAllowFileAccessSetting(extension->id())) {
1813 extension_prefs_->SetAllowFileAccess(extension->id(), true); 1813 extension_prefs_->SetAllowFileAccess(extension->id(), true);
1814 } 1814 }
1815 1815
1816 AddExtension(extension); 1816 AddExtension(extension);
1817 1817
1818 // Notify observers that need to know when an installation is complete. 1818 // Notify observers that need to know when an installation is complete.
1819 registry_->TriggerOnInstalled(extension); 1819 registry_->TriggerOnInstalled(extension, is_update);
1820 1820
1821 // Check extensions that may have been delayed only because this shared module 1821 // Check extensions that may have been delayed only because this shared module
1822 // was not available. 1822 // was not available.
1823 if (SharedModuleInfo::IsSharedModule(extension)) 1823 if (SharedModuleInfo::IsSharedModule(extension))
1824 MaybeFinishDelayedInstallations(); 1824 MaybeFinishDelayedInstallations();
1825 } 1825 }
1826 1826
1827 void ExtensionService::PromoteEphemeralApp( 1827 void ExtensionService::PromoteEphemeralApp(
1828 const extensions::Extension* extension, bool is_from_sync) { 1828 const extensions::Extension* extension, bool is_from_sync) {
1829 DCHECK(GetInstalledExtension(extension->id()) && 1829 DCHECK(GetInstalledExtension(extension->id()) &&
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
1867 1867
1868 if (registry_->enabled_extensions().Contains(extension->id())) { 1868 if (registry_->enabled_extensions().Contains(extension->id())) {
1869 content::NotificationService::current()->Notify( 1869 content::NotificationService::current()->Notify(
1870 chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED, 1870 chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
1871 content::Source<Profile>(profile_), 1871 content::Source<Profile>(profile_),
1872 content::Details<const Extension>(extension)); 1872 content::Details<const Extension>(extension));
1873 1873
1874 registry_->TriggerOnLoaded(extension); 1874 registry_->TriggerOnLoaded(extension);
1875 } 1875 }
1876 1876
1877 registry_->TriggerOnInstalled(extension); 1877 registry_->TriggerOnInstalled(extension, true);
1878 1878
1879 if (!is_from_sync && extension_sync_service_) 1879 if (!is_from_sync && extension_sync_service_)
1880 extension_sync_service_->SyncExtensionChangeIfNeeded(*extension); 1880 extension_sync_service_->SyncExtensionChangeIfNeeded(*extension);
1881 } 1881 }
1882 1882
1883 const Extension* ExtensionService::GetPendingExtensionUpdate( 1883 const Extension* ExtensionService::GetPendingExtensionUpdate(
1884 const std::string& id) const { 1884 const std::string& id) const {
1885 return delayed_installs_.GetByID(id); 1885 return delayed_installs_.GetByID(id);
1886 } 1886 }
1887 1887
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
2346 } 2346 }
2347 2347
2348 void ExtensionService::OnProfileDestructionStarted() { 2348 void ExtensionService::OnProfileDestructionStarted() {
2349 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); 2349 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs();
2350 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); 2350 for (ExtensionIdSet::iterator it = ids_to_unload.begin();
2351 it != ids_to_unload.end(); 2351 it != ids_to_unload.end();
2352 ++it) { 2352 ++it) {
2353 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); 2353 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN);
2354 } 2354 }
2355 } 2355 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/error_console/error_console.cc ('k') | chrome/browser/extensions/external_install_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698