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

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

Issue 12319114: Extract debugger target enumeration into a separate class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@debugger
Patch Set: Rebase Created 7 years, 9 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
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 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 if (current_extension) { 721 if (current_extension) {
722 // If the extension has an inspector open for its background page, detach 722 // If the extension has an inspector open for its background page, detach
723 // the inspector and hang onto a cookie for it, so that we can reattach 723 // the inspector and hang onto a cookie for it, so that we can reattach
724 // later. 724 // later.
725 // TODO(yoz): this is not incognito-safe! 725 // TODO(yoz): this is not incognito-safe!
726 ExtensionProcessManager* manager = system_->process_manager(); 726 ExtensionProcessManager* manager = system_->process_manager();
727 extensions::ExtensionHost* host = 727 extensions::ExtensionHost* host =
728 manager->GetBackgroundHostForExtension(extension_id); 728 manager->GetBackgroundHostForExtension(extension_id);
729 if (host && DevToolsAgentHost::HasFor(host->render_view_host())) { 729 if (host && DevToolsAgentHost::HasFor(host->render_view_host())) {
730 // Look for an open inspector for the background page. 730 // Look for an open inspector for the background page.
731 int devtools_cookie = DevToolsAgentHost::DisconnectRenderViewHost( 731 std::string devtools_cookie = DevToolsAgentHost::DisconnectRenderViewHost(
732 host->render_view_host()); 732 host->render_view_host());
733 if (devtools_cookie >= 0) 733 if (devtools_cookie != std::string())
734 orphaned_dev_tools_[extension_id] = devtools_cookie; 734 orphaned_dev_tools_[extension_id] = devtools_cookie;
735 } 735 }
736 736
737 path = current_extension->path(); 737 path = current_extension->path();
738 DisableExtension(extension_id, Extension::DISABLE_RELOAD); 738 DisableExtension(extension_id, Extension::DISABLE_RELOAD);
739 disabled_extension_paths_[extension_id] = path; 739 disabled_extension_paths_[extension_id] = path;
740 } else { 740 } else {
741 path = unloaded_extension_paths_[extension_id]; 741 path = unloaded_extension_paths_[extension_id];
742 } 742 }
743 743
(...skipping 2346 matching lines...) Expand 10 before | Expand all | Expand 10 after
3090 if (!extension) 3090 if (!extension)
3091 continue; 3091 continue;
3092 blacklisted_extensions_.Insert(extension); 3092 blacklisted_extensions_.Insert(extension);
3093 UnloadExtension(*it, extension_misc::UNLOAD_REASON_BLACKLIST); 3093 UnloadExtension(*it, extension_misc::UNLOAD_REASON_BLACKLIST);
3094 UMA_HISTOGRAM_ENUMERATION("ExtensionBlacklist.BlacklistInstalled", 3094 UMA_HISTOGRAM_ENUMERATION("ExtensionBlacklist.BlacklistInstalled",
3095 extension->location(), Manifest::NUM_LOCATIONS); 3095 extension->location(), Manifest::NUM_LOCATIONS);
3096 } 3096 }
3097 3097
3098 IdentifyAlertableExtensions(); 3098 IdentifyAlertableExtensions();
3099 } 3099 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_service.h ('k') | chrome/test/data/devtools/target_list/background.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698