Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/chromeos/app_mode/kiosk_app_update_install_gate.h" | |
| 6 | |
| 7 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" | |
| 8 #include "chrome/browser/profiles/profile.h" | |
| 9 #include "extensions/browser/extension_registry.h" | |
| 10 #include "extensions/common/extension.h" | |
| 11 | |
| 12 namespace chromeos { | |
| 13 | |
| 14 KioskAppUpdateInstallGate::KioskAppUpdateInstallGate(Profile* profile) | |
| 15 : profile_(profile), | |
| 16 registry_(extensions::ExtensionRegistry::Get(profile)) {} | |
| 17 | |
| 18 KioskAppUpdateInstallGate::~KioskAppUpdateInstallGate() {} | |
| 19 | |
| 20 extensions::InstallGate::Action KioskAppUpdateInstallGate::ShouldDelay( | |
| 21 const extensions::Extension* extension, | |
| 22 bool install_immediately) { | |
| 23 // Install if this is the first install or the required platform version is | |
| 24 // compliant with the current platform version. | |
| 25 if (!registry_->GetInstalledExtension(extension->id()) || | |
|
jennyz
2016/04/19 21:54:28
For first install case, if the required platform v
xiyuan
2016/04/19 22:28:45
Done.
| |
| 26 KioskAppManager::Get()->IsPlatformCompliantWithApp(extension)) { | |
| 27 return INSTALL; | |
| 28 } | |
| 29 | |
| 30 // Otherwise, delay install but update the required platform version meta data | |
| 31 // to allow update engine to move on to the new platform version. | |
| 32 KioskAppManager::Get()->UpdateAppDataFromProfile(extension->id(), profile_, | |
| 33 extension); | |
| 34 return DELAY; | |
| 35 } | |
| 36 | |
| 37 } // namespace chromeos | |
| OLD | NEW |