| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "chrome/browser/chromeos/app_mode/kiosk_app_data.h" | 5 #include "chrome/browser/chromeos/app_mode/kiosk_app_data.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 delete this; | 349 delete this; |
| 350 } | 350 } |
| 351 | 351 |
| 352 // WebstoreInstallHelper::Delegate overrides: | 352 // WebstoreInstallHelper::Delegate overrides: |
| 353 void OnWebstoreParseSuccess(const std::string& id, | 353 void OnWebstoreParseSuccess(const std::string& id, |
| 354 const SkBitmap& icon, | 354 const SkBitmap& icon, |
| 355 base::DictionaryValue* parsed_manifest) override { | 355 base::DictionaryValue* parsed_manifest) override { |
| 356 // Takes ownership of |parsed_manifest|. | 356 // Takes ownership of |parsed_manifest|. |
| 357 extensions::Manifest manifest( | 357 extensions::Manifest manifest( |
| 358 extensions::Manifest::INVALID_LOCATION, | 358 extensions::Manifest::INVALID_LOCATION, |
| 359 scoped_ptr<base::DictionaryValue>(parsed_manifest)); | 359 std::unique_ptr<base::DictionaryValue>(parsed_manifest)); |
| 360 | 360 |
| 361 if (!IsValidKioskAppManifest(manifest)) { | 361 if (!IsValidKioskAppManifest(manifest)) { |
| 362 ReportFailure(); | 362 ReportFailure(); |
| 363 return; | 363 return; |
| 364 } | 364 } |
| 365 | 365 |
| 366 std::string required_platform_version; | 366 std::string required_platform_version; |
| 367 if (manifest.HasPath( | 367 if (manifest.HasPath( |
| 368 extensions::manifest_keys::kKioskRequiredPlatformVersion) && | 368 extensions::manifest_keys::kKioskRequiredPlatformVersion) && |
| 369 (!manifest.GetString( | 369 (!manifest.GetString( |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 app_id_)); | 625 app_id_)); |
| 626 webstore_fetcher_->set_max_auto_retries(3); | 626 webstore_fetcher_->set_max_auto_retries(3); |
| 627 webstore_fetcher_->Start(); | 627 webstore_fetcher_->Start(); |
| 628 } | 628 } |
| 629 | 629 |
| 630 void KioskAppData::OnWebstoreRequestFailure() { | 630 void KioskAppData::OnWebstoreRequestFailure() { |
| 631 SetStatus(STATUS_ERROR); | 631 SetStatus(STATUS_ERROR); |
| 632 } | 632 } |
| 633 | 633 |
| 634 void KioskAppData::OnWebstoreResponseParseSuccess( | 634 void KioskAppData::OnWebstoreResponseParseSuccess( |
| 635 scoped_ptr<base::DictionaryValue> webstore_data) { | 635 std::unique_ptr<base::DictionaryValue> webstore_data) { |
| 636 // Takes ownership of |webstore_data|. | 636 // Takes ownership of |webstore_data|. |
| 637 webstore_fetcher_.reset(); | 637 webstore_fetcher_.reset(); |
| 638 | 638 |
| 639 std::string manifest; | 639 std::string manifest; |
| 640 if (!CheckResponseKeyValue(webstore_data.get(), kManifestKey, &manifest)) | 640 if (!CheckResponseKeyValue(webstore_data.get(), kManifestKey, &manifest)) |
| 641 return; | 641 return; |
| 642 | 642 |
| 643 if (!CheckResponseKeyValue(webstore_data.get(), kLocalizedNameKey, &name_)) | 643 if (!CheckResponseKeyValue(webstore_data.get(), kLocalizedNameKey, &name_)) |
| 644 return; | 644 return; |
| 645 | 645 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 | 704 |
| 705 SkBitmap icon = crx_loader->icon(); | 705 SkBitmap icon = crx_loader->icon(); |
| 706 if (icon.empty()) | 706 if (icon.empty()) |
| 707 icon = *extensions::util::GetDefaultAppIcon().bitmap(); | 707 icon = *extensions::util::GetDefaultAppIcon().bitmap(); |
| 708 SetCache(crx_loader->name(), icon, crx_loader->required_platform_version()); | 708 SetCache(crx_loader->name(), icon, crx_loader->required_platform_version()); |
| 709 | 709 |
| 710 SetStatus(STATUS_LOADED); | 710 SetStatus(STATUS_LOADED); |
| 711 } | 711 } |
| 712 | 712 |
| 713 } // namespace chromeos | 713 } // namespace chromeos |
| OLD | NEW |