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

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

Issue 405433003: Apps&Extensions for supervised users: Allow the custodian to remotely uninstall extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add test Created 6 years, 5 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 | Annotate | Revision Log
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 683 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 // managed extensions. 694 // managed extensions.
695 // Shared modules being uninstalled will also set |external_uninstall| to true 695 // Shared modules being uninstalled will also set |external_uninstall| to true
696 // so that we can guarantee users don't uninstall a shared module. 696 // so that we can guarantee users don't uninstall a shared module.
697 // (crbug.com/273300) 697 // (crbug.com/273300)
698 // TODO(rdevlin.cronin): This is probably not right. We should do something 698 // TODO(rdevlin.cronin): This is probably not right. We should do something
699 // else, like include an enum IS_INTERNAL_UNINSTALL or IS_USER_UNINSTALL so 699 // else, like include an enum IS_INTERNAL_UNINSTALL or IS_USER_UNINSTALL so
700 // we don't do this. 700 // we don't do this.
701 bool external_uninstall = 701 bool external_uninstall =
702 (reason == extensions::UNINSTALL_REASON_INTERNAL_MANAGEMENT) || 702 (reason == extensions::UNINSTALL_REASON_INTERNAL_MANAGEMENT) ||
703 (reason == extensions::UNINSTALL_REASON_ORPHANED_EXTERNAL_EXTENSION) || 703 (reason == extensions::UNINSTALL_REASON_ORPHANED_EXTERNAL_EXTENSION) ||
704 (reason == extensions::UNINSTALL_REASON_ORPHANED_SHARED_MODULE); 704 (reason == extensions::UNINSTALL_REASON_ORPHANED_SHARED_MODULE) ||
705 (reason == extensions::UNINSTALL_REASON_SYNC_BY_CUSTODIAN);
705 if (!external_uninstall && 706 if (!external_uninstall &&
706 !system_->management_policy()->UserMayModifySettings( 707 !system_->management_policy()->UserMayModifySettings(
707 extension.get(), error)) { 708 extension.get(), error)) {
708 content::NotificationService::current()->Notify( 709 content::NotificationService::current()->Notify(
709 chrome::NOTIFICATION_EXTENSION_UNINSTALL_NOT_ALLOWED, 710 chrome::NOTIFICATION_EXTENSION_UNINSTALL_NOT_ALLOWED,
710 content::Source<Profile>(profile_), 711 content::Source<Profile>(profile_),
711 content::Details<const Extension>(extension.get())); 712 content::Details<const Extension>(extension.get()));
712 return false; 713 return false;
713 } 714 }
714 715
(...skipping 1619 matching lines...) Expand 10 before | Expand all | Expand 10 after
2334 } 2335 }
2335 2336
2336 void ExtensionService::OnProfileDestructionStarted() { 2337 void ExtensionService::OnProfileDestructionStarted() {
2337 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); 2338 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs();
2338 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); 2339 for (ExtensionIdSet::iterator it = ids_to_unload.begin();
2339 it != ids_to_unload.end(); 2340 it != ids_to_unload.end();
2340 ++it) { 2341 ++it) {
2341 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); 2342 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN);
2342 } 2343 }
2343 } 2344 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698