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 <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 692 // managed extensions. | 692 // managed extensions. |
| 693 // Shared modules being uninstalled will also set |external_uninstall| to true | 693 // Shared modules being uninstalled will also set |external_uninstall| to true |
| 694 // so that we can guarantee users don't uninstall a shared module. | 694 // so that we can guarantee users don't uninstall a shared module. |
| 695 // (crbug.com/273300) | 695 // (crbug.com/273300) |
| 696 // TODO(rdevlin.cronin): This is probably not right. We should do something | 696 // TODO(rdevlin.cronin): This is probably not right. We should do something |
| 697 // else, like include an enum IS_INTERNAL_UNINSTALL or IS_USER_UNINSTALL so | 697 // else, like include an enum IS_INTERNAL_UNINSTALL or IS_USER_UNINSTALL so |
| 698 // we don't do this. | 698 // we don't do this. |
| 699 bool external_uninstall = | 699 bool external_uninstall = |
| 700 (reason == UNINSTALL_REASON_INTERNAL_MANAGEMENT) || | 700 (reason == UNINSTALL_REASON_INTERNAL_MANAGEMENT) || |
| 701 (reason == UNINSTALL_REASON_ORPHANED_EXTERNAL_EXTENSION) || | 701 (reason == UNINSTALL_REASON_ORPHANED_EXTERNAL_EXTENSION) || |
| 702 (reason == UNINSTALL_REASON_ORPHANED_SHARED_MODULE); | 702 (reason == UNINSTALL_REASON_ORPHANED_SHARED_MODULE) || |
| 703 (reason == UNINSTALL_REASON_SYNC_BY_CUSTODIAN); | |
|
not at google - send to devlin
2014/07/18 14:45:08
Thanks for updating the other call sites.
With th
not at google - send to devlin
2014/07/21 16:48:23
I guess I mean 2 things:
- you could not even trig
Marc Treib
2014/07/22 09:30:07
Ah, right, that'll work, and not require changes t
| |
| 703 if (!external_uninstall && | 704 if (!external_uninstall && |
| 704 !system_->management_policy()->UserMayModifySettings( | 705 !system_->management_policy()->UserMayModifySettings( |
| 705 extension.get(), error)) { | 706 extension.get(), error)) { |
| 706 content::NotificationService::current()->Notify( | 707 content::NotificationService::current()->Notify( |
| 707 chrome::NOTIFICATION_EXTENSION_UNINSTALL_NOT_ALLOWED, | 708 chrome::NOTIFICATION_EXTENSION_UNINSTALL_NOT_ALLOWED, |
| 708 content::Source<Profile>(profile_), | 709 content::Source<Profile>(profile_), |
| 709 content::Details<const Extension>(extension.get())); | 710 content::Details<const Extension>(extension.get())); |
| 710 return false; | 711 return false; |
| 711 } | 712 } |
| 712 | 713 |
| (...skipping 1617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2330 } | 2331 } |
| 2331 | 2332 |
| 2332 void ExtensionService::OnProfileDestructionStarted() { | 2333 void ExtensionService::OnProfileDestructionStarted() { |
| 2333 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); | 2334 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); |
| 2334 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); | 2335 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); |
| 2335 it != ids_to_unload.end(); | 2336 it != ids_to_unload.end(); |
| 2336 ++it) { | 2337 ++it) { |
| 2337 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); | 2338 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); |
| 2338 } | 2339 } |
| 2339 } | 2340 } |
| OLD | NEW |