| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 1700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1711 error_controller_->ShowErrorIfNeeded(); | 1711 error_controller_->ShowErrorIfNeeded(); |
| 1712 | 1712 |
| 1713 // Revokes blocked permissions from active_permissions for all extensions. | 1713 // Revokes blocked permissions from active_permissions for all extensions. |
| 1714 extensions::ExtensionManagement* settings = | 1714 extensions::ExtensionManagement* settings = |
| 1715 extensions::ExtensionManagementFactory::GetForBrowserContext(profile()); | 1715 extensions::ExtensionManagementFactory::GetForBrowserContext(profile()); |
| 1716 CHECK(settings); | 1716 CHECK(settings); |
| 1717 scoped_ptr<ExtensionSet> all_extensions( | 1717 scoped_ptr<ExtensionSet> all_extensions( |
| 1718 registry_->GenerateInstalledExtensionsSet()); | 1718 registry_->GenerateInstalledExtensionsSet()); |
| 1719 for (const auto& extension : *all_extensions.get()) { | 1719 for (const auto& extension : *all_extensions.get()) { |
| 1720 if (!settings->IsPermissionSetAllowed( | 1720 if (!settings->IsPermissionSetAllowed( |
| 1721 extension->id(), | 1721 extension.get(), |
| 1722 extension->permissions_data()->active_permissions())) { | 1722 extension->permissions_data()->active_permissions())) { |
| 1723 extensions::PermissionsUpdater(profile()).RemovePermissions( | 1723 extensions::PermissionsUpdater(profile()).RemovePermissions( |
| 1724 extension.get(), | 1724 extension.get(), |
| 1725 settings->GetBlockedPermissions(extension->id()).get()); | 1725 settings->GetBlockedPermissions(extension.get()).get()); |
| 1726 } | 1726 } |
| 1727 } | 1727 } |
| 1728 | 1728 |
| 1729 CheckManagementPolicy(); | 1729 CheckManagementPolicy(); |
| 1730 } | 1730 } |
| 1731 | 1731 |
| 1732 void ExtensionService::AddNewOrUpdatedExtension( | 1732 void ExtensionService::AddNewOrUpdatedExtension( |
| 1733 const Extension* extension, | 1733 const Extension* extension, |
| 1734 Extension::State initial_state, | 1734 Extension::State initial_state, |
| 1735 int install_flags, | 1735 int install_flags, |
| (...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2388 } | 2388 } |
| 2389 | 2389 |
| 2390 void ExtensionService::OnProfileDestructionStarted() { | 2390 void ExtensionService::OnProfileDestructionStarted() { |
| 2391 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); | 2391 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); |
| 2392 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); | 2392 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); |
| 2393 it != ids_to_unload.end(); | 2393 it != ids_to_unload.end(); |
| 2394 ++it) { | 2394 ++it) { |
| 2395 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); | 2395 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); |
| 2396 } | 2396 } |
| 2397 } | 2397 } |
| OLD | NEW |