Chromium Code Reviews| 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 1669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1680 // reason. | 1680 // reason. |
| 1681 if (is_privilege_increase && | 1681 if (is_privilege_increase && |
| 1682 !(disable_reasons & Extension::DISABLE_REMOTE_INSTALL)) { | 1682 !(disable_reasons & Extension::DISABLE_REMOTE_INSTALL)) { |
| 1683 disable_reasons |= Extension::DISABLE_PERMISSIONS_INCREASE; | 1683 disable_reasons |= Extension::DISABLE_PERMISSIONS_INCREASE; |
| 1684 if (!extension_prefs_->DidExtensionEscalatePermissions(extension->id())) | 1684 if (!extension_prefs_->DidExtensionEscalatePermissions(extension->id())) |
| 1685 RecordPermissionMessagesHistogram(extension, "AutoDisable"); | 1685 RecordPermissionMessagesHistogram(extension, "AutoDisable"); |
| 1686 | 1686 |
| 1687 #if defined(ENABLE_SUPERVISED_USERS) | 1687 #if defined(ENABLE_SUPERVISED_USERS) |
| 1688 // If a custodian-installed extension is disabled for a supervised user due | 1688 // If a custodian-installed extension is disabled for a supervised user due |
| 1689 // to a permissions increase, send a request to the custodian if the | 1689 // to a permissions increase, send a request to the custodian if the |
| 1690 // supervised user themselves can't re-enable the extension. | 1690 // supervised user themselves can't re-enable the extension. |
|
asargent_no_longer_on_chrome
2016/10/05 23:23:34
Should this comment be updated to reflect the fact
mamir
2016/10/06 09:09:23
Done.
| |
| 1691 if (extensions::util::IsExtensionSupervised(extension, profile_) && | 1691 if (extensions::util::IsExtensionSupervised(extension, profile_) && |
| 1692 extensions::util::NeedCustodianApprovalForPermissionIncrease( | |
| 1693 profile_) && | |
| 1694 !ExtensionSyncService::Get(profile_)->HasPendingReenable( | 1692 !ExtensionSyncService::Get(profile_)->HasPendingReenable( |
| 1695 extension->id(), *extension->version())) { | 1693 extension->id(), *extension->version())) { |
| 1696 SupervisedUserService* supervised_user_service = | 1694 SupervisedUserService* supervised_user_service = |
| 1697 SupervisedUserServiceFactory::GetForProfile(profile_); | 1695 SupervisedUserServiceFactory::GetForProfile(profile_); |
| 1698 supervised_user_service->AddExtensionUpdateRequest(extension->id(), | 1696 supervised_user_service->AddExtensionUpdateRequest(extension->id(), |
| 1699 *extension->version()); | 1697 *extension->version()); |
| 1700 } | 1698 } |
| 1701 #endif | 1699 #endif |
| 1702 } | 1700 } |
| 1703 | 1701 |
| (...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2479 } | 2477 } |
| 2480 | 2478 |
| 2481 void ExtensionService::OnProfileDestructionStarted() { | 2479 void ExtensionService::OnProfileDestructionStarted() { |
| 2482 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); | 2480 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); |
| 2483 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); | 2481 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); |
| 2484 it != ids_to_unload.end(); | 2482 it != ids_to_unload.end(); |
| 2485 ++it) { | 2483 ++it) { |
| 2486 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); | 2484 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); |
| 2487 } | 2485 } |
| 2488 } | 2486 } |
| OLD | NEW |