Chromium Code Reviews| Index: chrome/browser/extensions/extension_service.cc |
| diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc |
| index 018b5d67f65ca6d17bbc20944290d43685b1000c..3a0c4a7f50ed598d80550fcb52a0629bf9ccfd03 100644 |
| --- a/chrome/browser/extensions/extension_service.cc |
| +++ b/chrome/browser/extensions/extension_service.cc |
| @@ -99,6 +99,7 @@ |
| #endif |
| #if defined(OS_CHROMEOS) |
| +#include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
| #include "chrome/browser/chromeos/extensions/install_limiter.h" |
| #include "storage/browser/fileapi/file_system_backend.h" |
| #include "storage/browser/fileapi/file_system_context.h" |
| @@ -1812,6 +1813,26 @@ void ExtensionService::OnExtensionInstalled( |
| install_parameter); |
| delayed_installs_.Insert(extension); |
| } |
| +#if defined(OS_CHROMEOS) |
| + } else if (!chromeos::KioskAppManager::Get()->IsPlatformCompliantWithApp( |
| + extension) && |
| + !!GetInstalledExtension(extension->id())) { |
| + // Delay updating of an existing extension when required platform version |
| + // of the new extension is not compliant. |
| + extension_prefs_->SetDelayedInstallInfo( |
| + extension, |
| + initial_state, |
| + install_flags, |
| + extensions::ExtensionPrefs::DELAY_REASON_WAIT_FOR_OS_UPDATE, |
| + page_ordinal, |
| + install_parameter); |
| + delayed_installs_.Insert(extension); |
| + |
| + // Updates the required platform version meta data to allow update engine |
| + // to move on to the new OS version. |
| + chromeos::KioskAppManager::Get()->UpdateAppDataFromProfile( |
| + extension->id(), profile(), extension); |
| +#endif |
|
asargent_no_longer_on_chrome
2016/04/06 19:32:23
This function is already getting kind of long and
xiyuan
2016/04/19 18:38:54
Done.
|
| } else { |
| AddNewOrUpdatedExtension(extension, |
| initial_state, |
| @@ -1898,6 +1919,14 @@ void ExtensionService::MaybeFinishDelayedInstallation( |
| } |
| } |
| +#if defined(OS_CHROMEOS) |
| + if (reason == extensions::ExtensionPrefs::DELAY_REASON_WAIT_FOR_OS_UPDATE && |
| + !chromeos::KioskAppManager::Get()->IsPlatformCompliantWithApp( |
| + extension)) { |
| + return; |
| + } |
| +#endif |
| + |
| FinishDelayedInstallation(extension_id); |
| } |