| Index: chrome/browser/chromeos/app_mode/kiosk_app_data.cc
|
| diff --git a/chrome/browser/chromeos/app_mode/kiosk_app_data.cc b/chrome/browser/chromeos/app_mode/kiosk_app_data.cc
|
| index de83ec635a54a8c5be640c98336d095ab7669e4c..25f229d9190b6ae8b59ca8f44f2f979d401ce0a1 100644
|
| --- a/chrome/browser/chromeos/app_mode/kiosk_app_data.cc
|
| +++ b/chrome/browser/chromeos/app_mode/kiosk_app_data.cc
|
| @@ -259,6 +259,7 @@ KioskAppData::KioskAppData(KioskAppDataDelegate* delegate,
|
| const std::string& user_id)
|
| : delegate_(delegate),
|
| status_(STATUS_INIT),
|
| + crx_cache_status_(STATUS_INIT),
|
| app_id_(app_id),
|
| user_id_(user_id) {
|
| }
|
| @@ -316,6 +317,10 @@ bool KioskAppData::IsLoading() const {
|
| return status_ == STATUS_LOADING;
|
| }
|
|
|
| +bool KioskAppData::IsCrxCacheLoading() const {
|
| + return crx_cache_status_ == STATUS_LOADING;
|
| +}
|
| +
|
| void KioskAppData::SetStatus(Status status) {
|
| if (status_ == status)
|
| return;
|
| @@ -338,6 +343,33 @@ void KioskAppData::SetStatus(Status status) {
|
| };
|
| }
|
|
|
| +void KioskAppData::SetCrxCacheStatus(Status crx_cache_status) {
|
| + if (crx_cache_status_ == crx_cache_status)
|
| + return;
|
| +
|
| + Status old_cache_status = crx_cache_status_;
|
| + crx_cache_status_ = crx_cache_status;
|
| +
|
| + if (!delegate_)
|
| + return;
|
| +
|
| + switch (crx_cache_status_) {
|
| + case STATUS_INIT:
|
| + break;
|
| + case STATUS_LOADING:
|
| + delegate_->OnKioskAppDataChanged(app_id_);
|
| + break;
|
| + case STATUS_LOADED:
|
| + if (old_cache_status == STATUS_LOADING)
|
| + delegate_->OnKioskAppDataChanged(app_id_);
|
| + break;
|
| + case STATUS_ERROR:
|
| + if (old_cache_status == STATUS_LOADING)
|
| + delegate_->OnKioskAppDataLoadFailure(app_id_);
|
| + break;
|
| + }
|
| +}
|
| +
|
| net::URLRequestContextGetter* KioskAppData::GetRequestContextGetter() {
|
| return g_browser_process->system_request_context();
|
| }
|
|
|