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 1656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1667 if (!extension_prefs_->DidExtensionEscalatePermissions(extension->id())) { | 1667 if (!extension_prefs_->DidExtensionEscalatePermissions(extension->id())) { |
1668 RecordPermissionMessagesHistogram(extension, | 1668 RecordPermissionMessagesHistogram(extension, |
1669 "Extensions.Permissions_AutoDisable2"); | 1669 "Extensions.Permissions_AutoDisable2"); |
1670 } | 1670 } |
1671 extension_prefs_->SetExtensionState(extension->id(), Extension::DISABLED); | 1671 extension_prefs_->SetExtensionState(extension->id(), Extension::DISABLED); |
1672 extension_prefs_->SetDidExtensionEscalatePermissions(extension, true); | 1672 extension_prefs_->SetDidExtensionEscalatePermissions(extension, true); |
1673 | 1673 |
1674 #if defined(ENABLE_SUPERVISED_USERS) | 1674 #if defined(ENABLE_SUPERVISED_USERS) |
1675 // If a custodian-installed extension is disabled for a supervised user due | 1675 // If a custodian-installed extension is disabled for a supervised user due |
1676 // to a permissions increase, send a request to the custodian, since the | 1676 // to a permissions increase, send a request to the custodian, since the |
1677 // supervised user itself can't re-enable the extension. | 1677 // supervised user itself can't re-enable the extension. |
Bernhard Bauer
2015/03/23 16:18:39
Nit: "themselves" :)
Marc Treib
2015/03/23 16:26:46
Done.
| |
1678 if (extensions::util::IsExtensionSupervised(extension, profile_)) { | 1678 if (extensions::util::IsExtensionSupervised(extension, profile_)) { |
1679 SupervisedUserService* supervised_user_service = | 1679 SupervisedUserService* supervised_user_service = |
1680 SupervisedUserServiceFactory::GetForProfile(profile_); | 1680 SupervisedUserServiceFactory::GetForProfile(profile_); |
1681 supervised_user_service->AddExtensionUpdateRequest( | 1681 supervised_user_service->AddExtensionUpdateRequest( |
1682 extension->id(), | 1682 extension->id(), *extension->version(), |
1683 base::Bind(ExtensionUpdateRequestSent, extension->id())); | 1683 base::Bind(ExtensionUpdateRequestSent, extension->id())); |
1684 } | 1684 } |
1685 #endif | 1685 #endif |
1686 } | 1686 } |
1687 if (disable_reasons != Extension::DISABLE_NONE) { | 1687 if (disable_reasons != Extension::DISABLE_NONE) { |
1688 extension_prefs_->AddDisableReason( | 1688 extension_prefs_->AddDisableReason( |
1689 extension->id(), | 1689 extension->id(), |
1690 static_cast<Extension::DisableReason>(disable_reasons)); | 1690 static_cast<Extension::DisableReason>(disable_reasons)); |
1691 } | 1691 } |
1692 } | 1692 } |
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2581 } | 2581 } |
2582 | 2582 |
2583 void ExtensionService::OnProfileDestructionStarted() { | 2583 void ExtensionService::OnProfileDestructionStarted() { |
2584 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); | 2584 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); |
2585 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); | 2585 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); |
2586 it != ids_to_unload.end(); | 2586 it != ids_to_unload.end(); |
2587 ++it) { | 2587 ++it) { |
2588 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); | 2588 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); |
2589 } | 2589 } |
2590 } | 2590 } |
OLD | NEW |