OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <set> | 8 #include <set> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 orphaned_dev_tools_[extension_id] = devtools_cookie; | 709 orphaned_dev_tools_[extension_id] = devtools_cookie; |
710 } | 710 } |
711 | 711 |
712 path = current_extension->path(); | 712 path = current_extension->path(); |
713 DisableExtension(extension_id); | 713 DisableExtension(extension_id); |
714 disabled_extension_paths_[extension_id] = path; | 714 disabled_extension_paths_[extension_id] = path; |
715 } else { | 715 } else { |
716 path = unloaded_extension_paths_[extension_id]; | 716 path = unloaded_extension_paths_[extension_id]; |
717 } | 717 } |
718 | 718 |
| 719 // If we're reloading a component extension, use the component extension |
| 720 // loader's reloader. |
| 721 if (component_loader_->Exists(extension_id)) { |
| 722 component_loader_->Reload(extension_id); |
| 723 return; |
| 724 } |
| 725 |
719 // Check the installed extensions to see if what we're reloading was already | 726 // Check the installed extensions to see if what we're reloading was already |
720 // installed. | 727 // installed. |
721 scoped_ptr<ExtensionInfo> installed_extension( | 728 scoped_ptr<ExtensionInfo> installed_extension( |
722 extension_prefs_->GetInstalledExtensionInfo(extension_id)); | 729 extension_prefs_->GetInstalledExtensionInfo(extension_id)); |
723 if (installed_extension.get() && | 730 if (installed_extension.get() && |
724 installed_extension->extension_manifest.get()) { | 731 installed_extension->extension_manifest.get()) { |
725 extensions::InstalledLoader(this).Load(*installed_extension, false); | 732 extensions::InstalledLoader(this).Load(*installed_extension, false); |
726 } else { | 733 } else { |
727 // Otherwise, the extension is unpacked (location LOAD). | 734 // Otherwise, the extension is unpacked (location LOAD). |
728 // We should always be able to remember the extension's path. If it's not in | 735 // We should always be able to remember the extension's path. If it's not in |
(...skipping 1963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2692 // | 2699 // |
2693 // To coexist with certain unit tests that don't have an IO thread message | 2700 // To coexist with certain unit tests that don't have an IO thread message |
2694 // loop available at ExtensionService shutdown, we lazy-initialize this | 2701 // loop available at ExtensionService shutdown, we lazy-initialize this |
2695 // object so that those cases neither create nor destroy a SocketController. | 2702 // object so that those cases neither create nor destroy a SocketController. |
2696 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 2703 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
2697 if (!socket_controller_) { | 2704 if (!socket_controller_) { |
2698 socket_controller_ = new extensions::SocketController(); | 2705 socket_controller_ = new extensions::SocketController(); |
2699 } | 2706 } |
2700 return socket_controller_; | 2707 return socket_controller_; |
2701 } | 2708 } |
OLD | NEW |