| 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_manager.h" | 5 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/barrier_closure.h" | 10 #include "base/barrier_closure.h" |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 app_data.app_id() == currently_auto_launched_with_zero_delay_app_)); | 419 app_data.app_id() == currently_auto_launched_with_zero_delay_app_)); |
| 420 } | 420 } |
| 421 } | 421 } |
| 422 } | 422 } |
| 423 | 423 |
| 424 bool KioskAppManager::GetApp(const std::string& app_id, App* app) const { | 424 bool KioskAppManager::GetApp(const std::string& app_id, App* app) const { |
| 425 const KioskAppData* data = GetAppData(app_id); | 425 const KioskAppData* data = GetAppData(app_id); |
| 426 if (!data) | 426 if (!data) |
| 427 return false; | 427 return false; |
| 428 | 428 |
| 429 *app = App(*data, external_cache_->IsExtensionPending(app_id), | 429 if (app) { |
| 430 app_id == currently_auto_launched_with_zero_delay_app_); | 430 *app = App(*data, external_cache_->IsExtensionPending(app_id), |
| 431 app_id == currently_auto_launched_with_zero_delay_app_); |
| 432 } |
| 431 return true; | 433 return true; |
| 432 } | 434 } |
| 433 | 435 |
| 436 bool KioskAppManager::GetAppByAccountId(const AccountId& account_id, |
| 437 App* app) const { |
| 438 for (const auto& app_data : apps_) { |
| 439 if (app_data->account_id() == account_id) { |
| 440 if (app) { |
| 441 const std::string& app_id = app_data->app_id(); |
| 442 *app = App(*app_data, external_cache_->IsExtensionPending(app_id), |
| 443 app_id == currently_auto_launched_with_zero_delay_app_); |
| 444 } |
| 445 return true; |
| 446 } |
| 447 } |
| 448 return false; |
| 449 } |
| 450 |
| 434 bool KioskAppManager::GetDisableBailoutShortcut() const { | 451 bool KioskAppManager::GetDisableBailoutShortcut() const { |
| 435 bool enable; | 452 bool enable; |
| 436 if (CrosSettings::Get()->GetBoolean( | 453 if (CrosSettings::Get()->GetBoolean( |
| 437 kAccountsPrefDeviceLocalAccountAutoLoginBailoutEnabled, &enable)) { | 454 kAccountsPrefDeviceLocalAccountAutoLoginBailoutEnabled, &enable)) { |
| 438 return !enable; | 455 return !enable; |
| 439 } | 456 } |
| 440 | 457 |
| 441 return false; | 458 return false; |
| 442 } | 459 } |
| 443 | 460 |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 807 base::TimeDelta KioskAppManager::GetAutoLaunchDelay() const { | 824 base::TimeDelta KioskAppManager::GetAutoLaunchDelay() const { |
| 808 int delay; | 825 int delay; |
| 809 if (!CrosSettings::Get()->GetInteger( | 826 if (!CrosSettings::Get()->GetInteger( |
| 810 kAccountsPrefDeviceLocalAccountAutoLoginDelay, &delay)) { | 827 kAccountsPrefDeviceLocalAccountAutoLoginDelay, &delay)) { |
| 811 return base::TimeDelta(); // Default delay is 0ms. | 828 return base::TimeDelta(); // Default delay is 0ms. |
| 812 } | 829 } |
| 813 return base::TimeDelta::FromMilliseconds(delay); | 830 return base::TimeDelta::FromMilliseconds(delay); |
| 814 } | 831 } |
| 815 | 832 |
| 816 } // namespace chromeos | 833 } // namespace chromeos |
| OLD | NEW |