| 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 <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 if (it->type == policy::DeviceLocalAccount::TYPE_KIOSK_APP && | 234 if (it->type == policy::DeviceLocalAccount::TYPE_KIOSK_APP && |
| 235 it->kiosk_app_id == app_id) { | 235 it->kiosk_app_id == app_id) { |
| 236 return; | 236 return; |
| 237 } | 237 } |
| 238 } | 238 } |
| 239 | 239 |
| 240 // Add the new account. | 240 // Add the new account. |
| 241 device_local_accounts.push_back(policy::DeviceLocalAccount( | 241 device_local_accounts.push_back(policy::DeviceLocalAccount( |
| 242 policy::DeviceLocalAccount::TYPE_KIOSK_APP, | 242 policy::DeviceLocalAccount::TYPE_KIOSK_APP, |
| 243 GenerateKioskAppAccountId(app_id), | 243 GenerateKioskAppAccountId(app_id), |
| 244 app_id, | 244 app_id)); |
| 245 std::string())); | |
| 246 | 245 |
| 247 policy::SetDeviceLocalAccounts(CrosSettings::Get(), device_local_accounts); | 246 policy::SetDeviceLocalAccounts(CrosSettings::Get(), device_local_accounts); |
| 248 } | 247 } |
| 249 | 248 |
| 250 void KioskAppManager::RemoveApp(const std::string& app_id) { | 249 void KioskAppManager::RemoveApp(const std::string& app_id) { |
| 251 std::vector<policy::DeviceLocalAccount> device_local_accounts = | 250 std::vector<policy::DeviceLocalAccount> device_local_accounts = |
| 252 policy::GetDeviceLocalAccounts(CrosSettings::Get()); | 251 policy::GetDeviceLocalAccounts(CrosSettings::Get()); |
| 253 if (device_local_accounts.empty()) | 252 if (device_local_accounts.empty()) |
| 254 return; | 253 return; |
| 255 | 254 |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 | 429 |
| 431 void KioskAppManager::SetAutoLoginState(AutoLoginState state) { | 430 void KioskAppManager::SetAutoLoginState(AutoLoginState state) { |
| 432 PrefService* prefs = g_browser_process->local_state(); | 431 PrefService* prefs = g_browser_process->local_state(); |
| 433 DictionaryPrefUpdate dict_update(prefs, | 432 DictionaryPrefUpdate dict_update(prefs, |
| 434 KioskAppManager::kKioskDictionaryName); | 433 KioskAppManager::kKioskDictionaryName); |
| 435 dict_update->SetInteger(kKeyAutoLoginState, state); | 434 dict_update->SetInteger(kKeyAutoLoginState, state); |
| 436 prefs->CommitPendingWrite(); | 435 prefs->CommitPendingWrite(); |
| 437 } | 436 } |
| 438 | 437 |
| 439 } // namespace chromeos | 438 } // namespace chromeos |
| OLD | NEW |