Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2419)

Unified Diff: chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_manager.cc

Issue 2691063002: arc: Use AndroidKioskAppInfoProto.display_name() as ARC++ Kiosk app name. (Closed)
Patch Set: achuith@ comments Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_manager.cc
diff --git a/chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_manager.cc b/chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_manager.cc
index 1e9354c0bc6b433924c89e42087480af9819c8c5..48568e76cb039c1c3bde943a50705a328b35d63c 100644
--- a/chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_manager.cc
+++ b/chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_manager.cc
@@ -34,7 +34,7 @@ namespace {
// Preference for the dictionary of user ids for which cryptohomes have to be
// removed upon browser restart.
-const char kArcKioskUsersToRemove[] = "arc-kiosk-users-to-remove";
+constexpr char kArcKioskUsersToRemove[] = "arc-kiosk-users-to-remove";
void ScheduleDelayedCryptohomeRemoval(const cryptohome::Identification& id) {
PrefService* const local_state = g_browser_process->local_state();
@@ -117,7 +117,7 @@ ArcKioskAppManager::ArcKioskApp::ArcKioskApp(
const std::string& name)
: app_info_(app_info), account_id_(account_id), name_(name) {}
-ArcKioskAppManager::ArcKioskApp::~ArcKioskApp() {}
+ArcKioskAppManager::ArcKioskApp::~ArcKioskApp() = default;
bool ArcKioskAppManager::ArcKioskApp::operator==(
const policy::ArcKioskAppBasicInfo& app_info) const {
@@ -191,25 +191,27 @@ void ArcKioskAppManager::UpdateApps() {
// Re-populates |apps_| and reuses existing apps when possible.
const std::vector<policy::DeviceLocalAccount> device_local_accounts =
policy::GetDeviceLocalAccounts(CrosSettings::Get());
- for (std::vector<policy::DeviceLocalAccount>::const_iterator it =
- device_local_accounts.begin();
- it != device_local_accounts.end(); ++it) {
- if (it->type != policy::DeviceLocalAccount::TYPE_ARC_KIOSK_APP)
+ for (auto account : device_local_accounts) {
+ if (account.type != policy::DeviceLocalAccount::TYPE_ARC_KIOSK_APP)
continue;
- const AccountId account_id(AccountId::FromUserEmail(it->user_id));
+ const AccountId account_id(AccountId::FromUserEmail(account.user_id));
- if (it->account_id == auto_login_account_id_from_settings)
+ if (account.account_id == auto_login_account_id_from_settings)
auto_launch_account_id_ = account_id;
auto old_it =
- std::find(old_apps.begin(), old_apps.end(), it->arc_kiosk_app_info);
+ std::find(old_apps.begin(), old_apps.end(), account.arc_kiosk_app_info);
if (old_it != old_apps.end()) {
apps_.push_back(std::move(*old_it));
old_apps.erase(old_it);
} else {
- apps_.push_back(ArcKioskApp(it->arc_kiosk_app_info, account_id,
- it->arc_kiosk_app_info.package_name()));
+ // Use package name when display name is not specified.
+ std::string name = account.arc_kiosk_app_info.package_name();
+ if (!account.arc_kiosk_app_info.display_name().empty())
+ name = account.arc_kiosk_app_info.display_name();
+ apps_.push_back(
+ ArcKioskApp(account.arc_kiosk_app_info, account_id, name));
}
CancelDelayedCryptohomeRemoval(cryptohome::Identification(account_id));
}

Powered by Google App Engine
This is Rietveld 408576698