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 <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
675 scoped_ptr<ExtensionInfo> installed_extension( | 675 scoped_ptr<ExtensionInfo> installed_extension( |
676 extension_prefs_->GetInstalledExtensionInfo(extension_id)); | 676 extension_prefs_->GetInstalledExtensionInfo(extension_id)); |
677 if (installed_extension.get() && | 677 if (installed_extension.get() && |
678 installed_extension->extension_manifest.get()) { | 678 installed_extension->extension_manifest.get()) { |
679 extensions::InstalledLoader(this).Load(*installed_extension, false); | 679 extensions::InstalledLoader(this).Load(*installed_extension, false); |
680 } else { | 680 } else { |
681 // Otherwise, the extension is unpacked (location LOAD). | 681 // Otherwise, the extension is unpacked (location LOAD). |
682 // We should always be able to remember the extension's path. If it's not in | 682 // We should always be able to remember the extension's path. If it's not in |
683 // the map, someone failed to update |unloaded_extension_paths_|. | 683 // the map, someone failed to update |unloaded_extension_paths_|. |
684 CHECK(!path.empty()); | 684 CHECK(!path.empty()); |
685 extensions::UnpackedInstaller::Create(this)->Load(path); | 685 scoped_refptr<extensions::UnpackedInstaller> unpacked_installer = |
686 extensions::UnpackedInstaller::Create(this); | |
687 unpacked_installer->set_be_noisy_on_failure(false); | |
Devlin
2014/06/27 22:31:08
Won't this still have problems with things other t
gpdavis
2014/06/27 23:42:54
Oops, you're absolutely right. There must be some
| |
688 unpacked_installer->Load(path); | |
686 } | 689 } |
687 // When reloading is done, mark this extension as done reloading. | 690 // When reloading is done, mark this extension as done reloading. |
688 SetBeingReloaded(extension_id, false); | 691 SetBeingReloaded(extension_id, false); |
689 } | 692 } |
690 | 693 |
691 bool ExtensionService::UninstallExtension( | 694 bool ExtensionService::UninstallExtension( |
692 // "transient" because the process of uninstalling may cause the reference | 695 // "transient" because the process of uninstalling may cause the reference |
693 // to become invalid. Instead, use |extenson->id()|. | 696 // to become invalid. Instead, use |extenson->id()|. |
694 const std::string& transient_extension_id, | 697 const std::string& transient_extension_id, |
695 bool external_uninstall, | 698 bool external_uninstall, |
(...skipping 1760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2456 } | 2459 } |
2457 | 2460 |
2458 void ExtensionService::OnProfileDestructionStarted() { | 2461 void ExtensionService::OnProfileDestructionStarted() { |
2459 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); | 2462 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); |
2460 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); | 2463 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); |
2461 it != ids_to_unload.end(); | 2464 it != ids_to_unload.end(); |
2462 ++it) { | 2465 ++it) { |
2463 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); | 2466 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); |
2464 } | 2467 } |
2465 } | 2468 } |
OLD | NEW |