| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_EXTERNAL_UPDATER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_EXTERNAL_UPDATER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_EXTERNAL_UPDATER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_EXTERNAL_UPDATER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 ERROR_NONE, | 28 ERROR_NONE, |
| 29 ERROR_NO_MANIFEST, | 29 ERROR_NO_MANIFEST, |
| 30 ERROR_INVALID_MANIFEST, | 30 ERROR_INVALID_MANIFEST, |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 KioskExternalUpdater( | 33 KioskExternalUpdater( |
| 34 const scoped_refptr<base::SequencedTaskRunner>& backend_task_runner, | 34 const scoped_refptr<base::SequencedTaskRunner>& backend_task_runner, |
| 35 const base::FilePath& crx_cache_dir, | 35 const base::FilePath& crx_cache_dir, |
| 36 const base::FilePath& crx_unpack_dir); | 36 const base::FilePath& crx_unpack_dir); |
| 37 | 37 |
| 38 virtual ~KioskExternalUpdater(); | 38 ~KioskExternalUpdater() override; |
| 39 | 39 |
| 40 private: | 40 private: |
| 41 enum ExternalUpdateStatus { | 41 enum ExternalUpdateStatus { |
| 42 PENDING, | 42 PENDING, |
| 43 SUCCESS, | 43 SUCCESS, |
| 44 FAILED, | 44 FAILED, |
| 45 }; | 45 }; |
| 46 struct ExternalUpdate { | 46 struct ExternalUpdate { |
| 47 ExternalUpdate(); | 47 ExternalUpdate(); |
| 48 | 48 |
| 49 std::string app_name; | 49 std::string app_name; |
| 50 base::FilePath external_crx; | 50 base::FilePath external_crx; |
| 51 ExternalUpdateStatus update_status; | 51 ExternalUpdateStatus update_status; |
| 52 base::string16 error; | 52 base::string16 error; |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 // disks::DiskMountManager::Observer overrides. | 55 // disks::DiskMountManager::Observer overrides. |
| 56 virtual void OnDiskEvent(disks::DiskMountManager::DiskEvent event, | 56 void OnDiskEvent(disks::DiskMountManager::DiskEvent event, |
| 57 const disks::DiskMountManager::Disk* disk) override; | 57 const disks::DiskMountManager::Disk* disk) override; |
| 58 virtual void OnDeviceEvent(disks::DiskMountManager::DeviceEvent event, | 58 void OnDeviceEvent(disks::DiskMountManager::DeviceEvent event, |
| 59 const std::string& device_path) override; | 59 const std::string& device_path) override; |
| 60 virtual void OnMountEvent( | 60 void OnMountEvent( |
| 61 disks::DiskMountManager::MountEvent event, | 61 disks::DiskMountManager::MountEvent event, |
| 62 MountError error_code, | 62 MountError error_code, |
| 63 const disks::DiskMountManager::MountPointInfo& mount_info) override; | 63 const disks::DiskMountManager::MountPointInfo& mount_info) override; |
| 64 virtual void OnFormatEvent(disks::DiskMountManager::FormatEvent event, | 64 void OnFormatEvent(disks::DiskMountManager::FormatEvent event, |
| 65 FormatError error_code, | 65 FormatError error_code, |
| 66 const std::string& device_path) override; | 66 const std::string& device_path) override; |
| 67 | 67 |
| 68 // KioskExternalUpdateValidatorDelegate overrides: | 68 // KioskExternalUpdateValidatorDelegate overrides: |
| 69 virtual void OnExtenalUpdateUnpackSuccess( | 69 void OnExtenalUpdateUnpackSuccess(const std::string& app_id, |
| 70 const std::string& app_id, | 70 const std::string& version, |
| 71 const std::string& version, | 71 const std::string& min_browser_version, |
| 72 const std::string& min_browser_version, | 72 const base::FilePath& temp_dir) override; |
| 73 const base::FilePath& temp_dir) override; | 73 void OnExternalUpdateUnpackFailure(const std::string& app_id) override; |
| 74 virtual void OnExternalUpdateUnpackFailure( | |
| 75 const std::string& app_id) override; | |
| 76 | 74 |
| 77 // Processes the parsed external update manifest, check |parsing_error| for | 75 // Processes the parsed external update manifest, check |parsing_error| for |
| 78 // any manifest parsing error. | 76 // any manifest parsing error. |
| 79 void ProcessParsedManifest(ExternalUpdateErrorCode* parsing_error, | 77 void ProcessParsedManifest(ExternalUpdateErrorCode* parsing_error, |
| 80 const base::FilePath& external_update_dir, | 78 const base::FilePath& external_update_dir, |
| 81 base::DictionaryValue* parsed_manifest); | 79 base::DictionaryValue* parsed_manifest); |
| 82 | 80 |
| 83 // Returns true if |external_update_| is interrupted before the updating | 81 // Returns true if |external_update_| is interrupted before the updating |
| 84 // completes. | 82 // completes. |
| 85 bool CheckExternalUpdateInterrupted(); | 83 bool CheckExternalUpdateInterrupted(); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 scoped_ptr<KioskExternalUpdateNotification> notification_; | 143 scoped_ptr<KioskExternalUpdateNotification> notification_; |
| 146 | 144 |
| 147 base::WeakPtrFactory<KioskExternalUpdater> weak_factory_; | 145 base::WeakPtrFactory<KioskExternalUpdater> weak_factory_; |
| 148 | 146 |
| 149 DISALLOW_COPY_AND_ASSIGN(KioskExternalUpdater); | 147 DISALLOW_COPY_AND_ASSIGN(KioskExternalUpdater); |
| 150 }; | 148 }; |
| 151 | 149 |
| 152 } // namespace chromeos | 150 } // namespace chromeos |
| 153 | 151 |
| 154 #endif // CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_EXTERNAL_UPDATER_H_ | 152 #endif // CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_EXTERNAL_UPDATER_H_ |
| OLD | NEW |