OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 2103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2114 return *iter; | 2114 return *iter; |
2115 } | 2115 } |
2116 } | 2116 } |
2117 return NULL; | 2117 return NULL; |
2118 } | 2118 } |
2119 | 2119 |
2120 void ExtensionService::TrackTerminatedExtension(const Extension* extension) { | 2120 void ExtensionService::TrackTerminatedExtension(const Extension* extension) { |
2121 if (terminated_extension_ids_.insert(extension->id()).second) | 2121 if (terminated_extension_ids_.insert(extension->id()).second) |
2122 terminated_extensions_.push_back(make_scoped_refptr(extension)); | 2122 terminated_extensions_.push_back(make_scoped_refptr(extension)); |
2123 | 2123 |
2124 UnloadExtension(extension->id(), extension_misc::UNLOAD_REASON_DISABLE); | 2124 // TODO(yoz): Listen to navcontrollers for that extension. Is this a todo? |
| 2125 |
| 2126 // TODO(yoz): make sure this is okay in *ALL* the listeners! |
| 2127 UnloadExtension(extension->id(), extension_misc::UNLOAD_REASON_TERMINATE); |
2125 } | 2128 } |
2126 | 2129 |
2127 void ExtensionService::UntrackTerminatedExtension(const std::string& id) { | 2130 void ExtensionService::UntrackTerminatedExtension(const std::string& id) { |
2128 std::string lowercase_id = StringToLowerASCII(id); | 2131 std::string lowercase_id = StringToLowerASCII(id); |
2129 if (terminated_extension_ids_.erase(lowercase_id) <= 0) | 2132 if (terminated_extension_ids_.erase(lowercase_id) <= 0) |
2130 return; | 2133 return; |
2131 | 2134 |
2132 for (ExtensionList::iterator iter = terminated_extensions_.begin(); | 2135 for (ExtensionList::iterator iter = terminated_extensions_.begin(); |
2133 iter != terminated_extensions_.end(); ++iter) { | 2136 iter != terminated_extensions_.end(); ++iter) { |
2134 if ((*iter)->id() == lowercase_id) { | 2137 if ((*iter)->id() == lowercase_id) { |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2490 | 2493 |
2491 ExtensionService::NaClModuleInfoList::iterator | 2494 ExtensionService::NaClModuleInfoList::iterator |
2492 ExtensionService::FindNaClModule(const GURL& url) { | 2495 ExtensionService::FindNaClModule(const GURL& url) { |
2493 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); | 2496 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); |
2494 iter != nacl_module_list_.end(); ++iter) { | 2497 iter != nacl_module_list_.end(); ++iter) { |
2495 if (iter->url == url) | 2498 if (iter->url == url) |
2496 return iter; | 2499 return iter; |
2497 } | 2500 } |
2498 return nacl_module_list_.end(); | 2501 return nacl_module_list_.end(); |
2499 } | 2502 } |
OLD | NEW |