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 <iterator> | 8 #include <iterator> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
723 if (current_extension) { | 723 if (current_extension) { |
724 // If the extension has an inspector open for its background page, detach | 724 // If the extension has an inspector open for its background page, detach |
725 // the inspector and hang onto a cookie for it, so that we can reattach | 725 // the inspector and hang onto a cookie for it, so that we can reattach |
726 // later. | 726 // later. |
727 // TODO(yoz): this is not incognito-safe! | 727 // TODO(yoz): this is not incognito-safe! |
728 ExtensionProcessManager* manager = system_->process_manager(); | 728 ExtensionProcessManager* manager = system_->process_manager(); |
729 extensions::ExtensionHost* host = | 729 extensions::ExtensionHost* host = |
730 manager->GetBackgroundHostForExtension(extension_id); | 730 manager->GetBackgroundHostForExtension(extension_id); |
731 if (host && DevToolsAgentHost::HasFor(host->render_view_host())) { | 731 if (host && DevToolsAgentHost::HasFor(host->render_view_host())) { |
732 // Look for an open inspector for the background page. | 732 // Look for an open inspector for the background page. |
733 int devtools_cookie = DevToolsAgentHost::DisconnectRenderViewHost( | 733 std::string devtools_cookie = DevToolsAgentHost::DisconnectRenderViewHost( |
734 host->render_view_host()); | 734 host->render_view_host()); |
735 if (devtools_cookie >= 0) | 735 if (devtools_cookie != DevToolsAgentHost::NullId) |
736 orphaned_dev_tools_[extension_id] = devtools_cookie; | 736 orphaned_dev_tools_[extension_id] = devtools_cookie; |
737 } | 737 } |
738 | 738 |
739 path = current_extension->path(); | 739 path = current_extension->path(); |
740 DisableExtension(extension_id, Extension::DISABLE_RELOAD); | 740 DisableExtension(extension_id, Extension::DISABLE_RELOAD); |
741 disabled_extension_paths_[extension_id] = path; | 741 disabled_extension_paths_[extension_id] = path; |
742 } else { | 742 } else { |
743 path = unloaded_extension_paths_[extension_id]; | 743 path = unloaded_extension_paths_[extension_id]; |
744 } | 744 } |
745 | 745 |
(...skipping 2378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3124 if (!extension) | 3124 if (!extension) |
3125 continue; | 3125 continue; |
3126 blacklisted_extensions_.Insert(extension); | 3126 blacklisted_extensions_.Insert(extension); |
3127 UnloadExtension(*it, extension_misc::UNLOAD_REASON_BLACKLIST); | 3127 UnloadExtension(*it, extension_misc::UNLOAD_REASON_BLACKLIST); |
3128 UMA_HISTOGRAM_ENUMERATION("ExtensionBlacklist.BlacklistInstalled", | 3128 UMA_HISTOGRAM_ENUMERATION("ExtensionBlacklist.BlacklistInstalled", |
3129 extension->location(), Manifest::NUM_LOCATIONS); | 3129 extension->location(), Manifest::NUM_LOCATIONS); |
3130 } | 3130 } |
3131 | 3131 |
3132 IdentifyAlertableExtensions(); | 3132 IdentifyAlertableExtensions(); |
3133 } | 3133 } |
OLD | NEW |