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

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

Issue 1028123002: Supervised users: Include extension version in update requests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: unit_tests Created 5 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_service_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <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
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 themselves can't re-enable the extension.
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698