| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <iterator> | 10 #include <iterator> |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 i != external_extension_providers_.end(); ++i) { | 372 i != external_extension_providers_.end(); ++i) { |
| 373 extensions::ExternalProviderInterface* provider = i->get(); | 373 extensions::ExternalProviderInterface* provider = i->get(); |
| 374 provider->ServiceShutdown(); | 374 provider->ServiceShutdown(); |
| 375 } | 375 } |
| 376 } | 376 } |
| 377 | 377 |
| 378 void ExtensionService::Shutdown() { | 378 void ExtensionService::Shutdown() { |
| 379 extensions::ExtensionManagementFactory::GetInstance() | 379 extensions::ExtensionManagementFactory::GetInstance() |
| 380 ->GetForBrowserContext(profile()) | 380 ->GetForBrowserContext(profile()) |
| 381 ->RemoveObserver(this); | 381 ->RemoveObserver(this); |
| 382 system_->management_policy()->UnregisterProvider( | |
| 383 shared_module_policy_provider_.get()); | |
| 384 } | 382 } |
| 385 | 383 |
| 386 const Extension* ExtensionService::GetExtensionById( | 384 const Extension* ExtensionService::GetExtensionById( |
| 387 const std::string& id, bool include_disabled) const { | 385 const std::string& id, bool include_disabled) const { |
| 388 int include_mask = ExtensionRegistry::ENABLED; | 386 int include_mask = ExtensionRegistry::ENABLED; |
| 389 if (include_disabled) { | 387 if (include_disabled) { |
| 390 // Include blacklisted and blocked extensions here because there are | 388 // Include blacklisted and blocked extensions here because there are |
| 391 // hundreds of callers of this function, and many might assume that this | 389 // hundreds of callers of this function, and many might assume that this |
| 392 // includes those that have been disabled due to blacklisting or blocking. | 390 // includes those that have been disabled due to blacklisting or blocking. |
| 393 include_mask |= ExtensionRegistry::DISABLED | | 391 include_mask |= ExtensionRegistry::DISABLED | |
| (...skipping 2073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2467 } | 2465 } |
| 2468 | 2466 |
| 2469 void ExtensionService::OnProfileDestructionStarted() { | 2467 void ExtensionService::OnProfileDestructionStarted() { |
| 2470 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); | 2468 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); |
| 2471 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); | 2469 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); |
| 2472 it != ids_to_unload.end(); | 2470 it != ids_to_unload.end(); |
| 2473 ++it) { | 2471 ++it) { |
| 2474 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); | 2472 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); |
| 2475 } | 2473 } |
| 2476 } | 2474 } |
| OLD | NEW |