| Index: chrome/browser/apps/drive/drive_app_provider.cc
|
| diff --git a/chrome/browser/apps/drive/drive_app_provider.cc b/chrome/browser/apps/drive/drive_app_provider.cc
|
| index 795276474f2babac3b4ffaeed627e4e5b37e54d5..f9f8f93c1b9844cc731bdfe6f50bf862cdca3f88 100644
|
| --- a/chrome/browser/apps/drive/drive_app_provider.cc
|
| +++ b/chrome/browser/apps/drive/drive_app_provider.cc
|
| @@ -80,11 +80,16 @@ void DriveAppProvider::UpdateMappingAndExtensionSystem(
|
| ExtensionRegistry::Get(profile_)->GetExtensionById(
|
| existing_chrome_app_id, ExtensionRegistry::EVERYTHING);
|
| if (existing_app && is_existing_app_generated) {
|
| + // If the new app was installed by the custodian, also use custodian
|
| + // privileges for removing the old one.
|
| + ExtensionService::UninstallReason reason =
|
| + new_app->was_installed_by_custodian() ?
|
| + ExtensionService::UNINSTALL_REASON_SYNC_BY_CUSTODIAN :
|
| + ExtensionService::UNINSTALL_REASON_SYNC;
|
| +
|
| extensions::ExtensionSystem::Get(profile_)
|
| ->extension_service()
|
| - ->UninstallExtension(existing_chrome_app_id,
|
| - ExtensionService::UNINSTALL_REASON_SYNC,
|
| - NULL);
|
| + ->UninstallExtension(existing_chrome_app_id, reason, NULL);
|
| }
|
| }
|
|
|
| @@ -191,10 +196,13 @@ void DriveAppProvider::ProcessRemovedDriveApp(const std::string& drive_app_id) {
|
| if (!existing_app)
|
| return;
|
|
|
| + ExtensionService::UninstallReason reason =
|
| + existing_app->was_installed_by_custodian() ?
|
| + ExtensionService::UNINSTALL_REASON_SYNC_BY_CUSTODIAN :
|
| + ExtensionService::UNINSTALL_REASON_SYNC;
|
| extensions::ExtensionSystem::Get(profile_)
|
| ->extension_service()
|
| - ->UninstallExtension(
|
| - chrome_app_id, ExtensionService::UNINSTALL_REASON_SYNC, NULL);
|
| + ->UninstallExtension(chrome_app_id, reason, NULL);
|
| }
|
|
|
| void DriveAppProvider::OnDriveAppRegistryUpdated() {
|
|
|