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 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 | 470 |
471 bool KioskAppData::IsFromWebStore() const { | 471 bool KioskAppData::IsFromWebStore() const { |
472 return update_url_.is_empty() || | 472 return update_url_.is_empty() || |
473 extension_urls::IsWebstoreUpdateUrl(update_url_); | 473 extension_urls::IsWebstoreUpdateUrl(update_url_); |
474 } | 474 } |
475 | 475 |
476 void KioskAppData::SetStatusForTest(Status status) { | 476 void KioskAppData::SetStatusForTest(Status status) { |
477 SetStatus(status); | 477 SetStatus(status); |
478 } | 478 } |
479 | 479 |
| 480 // static |
| 481 std::unique_ptr<KioskAppData> KioskAppData::CreateForTest( |
| 482 KioskAppDataDelegate* delegate, |
| 483 const std::string& app_id, |
| 484 const AccountId& account_id, |
| 485 const GURL& update_url, |
| 486 const std::string& required_platform_version) { |
| 487 std::unique_ptr<KioskAppData> data(new KioskAppData( |
| 488 delegate, app_id, account_id, update_url, base::FilePath())); |
| 489 data->status_ = STATUS_LOADED; |
| 490 data->required_platform_version_ = required_platform_version; |
| 491 return data; |
| 492 } |
| 493 |
480 void KioskAppData::SetStatus(Status status) { | 494 void KioskAppData::SetStatus(Status status) { |
481 if (status_ == status) | 495 if (status_ == status) |
482 return; | 496 return; |
483 | 497 |
484 status_ = status; | 498 status_ = status; |
485 | 499 |
486 if (!delegate_) | 500 if (!delegate_) |
487 return; | 501 return; |
488 | 502 |
489 switch (status_) { | 503 switch (status_) { |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
704 | 718 |
705 SkBitmap icon = crx_loader->icon(); | 719 SkBitmap icon = crx_loader->icon(); |
706 if (icon.empty()) | 720 if (icon.empty()) |
707 icon = *extensions::util::GetDefaultAppIcon().bitmap(); | 721 icon = *extensions::util::GetDefaultAppIcon().bitmap(); |
708 SetCache(crx_loader->name(), icon, crx_loader->required_platform_version()); | 722 SetCache(crx_loader->name(), icon, crx_loader->required_platform_version()); |
709 | 723 |
710 SetStatus(STATUS_LOADED); | 724 SetStatus(STATUS_LOADED); |
711 } | 725 } |
712 | 726 |
713 } // namespace chromeos | 727 } // namespace chromeos |
OLD | NEW |