OLD | NEW |
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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <iterator> | 10 #include <iterator> |
(...skipping 1840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1851 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1851 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
1852 extension_prefs_->OnExtensionInstalled( | 1852 extension_prefs_->OnExtensionInstalled( |
1853 extension, initial_state, page_ordinal, install_flags, install_parameter); | 1853 extension, initial_state, page_ordinal, install_flags, install_parameter); |
1854 delayed_installs_.Remove(extension->id()); | 1854 delayed_installs_.Remove(extension->id()); |
1855 if (InstallVerifier::NeedsVerification(*extension)) | 1855 if (InstallVerifier::NeedsVerification(*extension)) |
1856 InstallVerifier::Get(GetBrowserContext())->VerifyExtension(extension->id()); | 1856 InstallVerifier::Get(GetBrowserContext())->VerifyExtension(extension->id()); |
1857 | 1857 |
1858 const Extension* old = GetInstalledExtension(extension->id()); | 1858 const Extension* old = GetInstalledExtension(extension->id()); |
1859 if (extensions::AppDataMigrator::NeedsMigration(old, extension)) { | 1859 if (extensions::AppDataMigrator::NeedsMigration(old, extension)) { |
1860 app_data_migrator_->DoMigrationAndReply( | 1860 app_data_migrator_->DoMigrationAndReply( |
1861 old, extension, | 1861 old, extension, base::Bind(&ExtensionService::FinishInstallation, |
1862 base::Bind(&ExtensionService::FinishInstallation, AsWeakPtr(), | 1862 AsWeakPtr(), base::RetainedRef(extension))); |
1863 make_scoped_refptr(extension))); | |
1864 return; | 1863 return; |
1865 } | 1864 } |
1866 | 1865 |
1867 FinishInstallation(extension); | 1866 FinishInstallation(extension); |
1868 } | 1867 } |
1869 | 1868 |
1870 void ExtensionService::MaybeFinishDelayedInstallation( | 1869 void ExtensionService::MaybeFinishDelayedInstallation( |
1871 const std::string& extension_id) { | 1870 const std::string& extension_id) { |
1872 // Check if the extension already got installed. | 1871 // Check if the extension already got installed. |
1873 if (!delayed_installs_.Contains(extension_id)) | 1872 if (!delayed_installs_.Contains(extension_id)) |
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2452 } | 2451 } |
2453 | 2452 |
2454 void ExtensionService::OnProfileDestructionStarted() { | 2453 void ExtensionService::OnProfileDestructionStarted() { |
2455 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); | 2454 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); |
2456 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); | 2455 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); |
2457 it != ids_to_unload.end(); | 2456 it != ids_to_unload.end(); |
2458 ++it) { | 2457 ++it) { |
2459 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); | 2458 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); |
2460 } | 2459 } |
2461 } | 2460 } |
OLD | NEW |