Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: chrome/browser/extensions/extension_service.cc

Issue 2396903002: Supervised Users always need custodian approval for permission increase (Closed)
Patch Set: Remove deleted method from the header file. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1668 matching lines...) Expand 10 before | Expand all | Expand 10 after
1679 // disabled because it was installed remotely, don't add another disable 1679 // disabled because it was installed remotely, don't add another disable
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.
1690 // supervised user themselves can't re-enable the extension.
1691 if (extensions::util::IsExtensionSupervised(extension, profile_) && 1690 if (extensions::util::IsExtensionSupervised(extension, profile_) &&
1692 extensions::util::NeedCustodianApprovalForPermissionIncrease(
1693 profile_) &&
1694 !ExtensionSyncService::Get(profile_)->HasPendingReenable( 1691 !ExtensionSyncService::Get(profile_)->HasPendingReenable(
1695 extension->id(), *extension->version())) { 1692 extension->id(), *extension->version())) {
1696 SupervisedUserService* supervised_user_service = 1693 SupervisedUserService* supervised_user_service =
1697 SupervisedUserServiceFactory::GetForProfile(profile_); 1694 SupervisedUserServiceFactory::GetForProfile(profile_);
1698 supervised_user_service->AddExtensionUpdateRequest(extension->id(), 1695 supervised_user_service->AddExtensionUpdateRequest(extension->id(),
1699 *extension->version()); 1696 *extension->version());
1700 } 1697 }
1701 #endif 1698 #endif
1702 } 1699 }
1703 1700
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after
2479 } 2476 }
2480 2477
2481 void ExtensionService::OnProfileDestructionStarted() { 2478 void ExtensionService::OnProfileDestructionStarted() {
2482 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); 2479 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs();
2483 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); 2480 for (ExtensionIdSet::iterator it = ids_to_unload.begin();
2484 it != ids_to_unload.end(); 2481 it != ids_to_unload.end();
2485 ++it) { 2482 ++it) {
2486 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); 2483 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN);
2487 } 2484 }
2488 } 2485 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_disabled_ui.cc ('k') | chrome/browser/extensions/extension_service_sync_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698