| 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 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 | 318 |
| 319 std::unique_ptr<base::DictionaryValue> apps_dict(new base::DictionaryValue); | 319 std::unique_ptr<base::DictionaryValue> apps_dict(new base::DictionaryValue); |
| 320 apps_dict->SetString(app_id + ".name", app_name); | 320 apps_dict->SetString(app_id + ".name", app_name); |
| 321 apps_dict->SetString(app_id + ".icon", icon_path.MaybeAsASCII()); | 321 apps_dict->SetString(app_id + ".icon", icon_path.MaybeAsASCII()); |
| 322 apps_dict->SetString(app_id + ".required_platform_version", | 322 apps_dict->SetString(app_id + ".required_platform_version", |
| 323 required_platform_version); | 323 required_platform_version); |
| 324 | 324 |
| 325 PrefService* local_state = g_browser_process->local_state(); | 325 PrefService* local_state = g_browser_process->local_state(); |
| 326 DictionaryPrefUpdate dict_update(local_state, | 326 DictionaryPrefUpdate dict_update(local_state, |
| 327 KioskAppManager::kKioskDictionaryName); | 327 KioskAppManager::kKioskDictionaryName); |
| 328 dict_update->Set(KioskAppManager::kKeyApps, apps_dict.release()); | 328 dict_update->Set(KioskAppManager::kKeyApps, std::move(apps_dict)); |
| 329 | 329 |
| 330 // Make the app appear in device settings. | 330 // Make the app appear in device settings. |
| 331 base::ListValue device_local_accounts; | 331 base::ListValue device_local_accounts; |
| 332 std::unique_ptr<base::DictionaryValue> entry(new base::DictionaryValue); | 332 std::unique_ptr<base::DictionaryValue> entry(new base::DictionaryValue); |
| 333 // Fake an account id. Note this needs to match GenerateKioskAppAccountId | 333 // Fake an account id. Note this needs to match GenerateKioskAppAccountId |
| 334 // in kiosk_app_manager.cc to make SetAutoLaunchApp work with the | 334 // in kiosk_app_manager.cc to make SetAutoLaunchApp work with the |
| 335 // existing app entry created here. | 335 // existing app entry created here. |
| 336 entry->SetStringWithoutPathExpansion(kAccountsPrefDeviceLocalAccountsKeyId, | 336 entry->SetStringWithoutPathExpansion(kAccountsPrefDeviceLocalAccountsKeyId, |
| 337 app_id + "@kiosk-apps"); | 337 app_id + "@kiosk-apps"); |
| 338 entry->SetIntegerWithoutPathExpansion( | 338 entry->SetIntegerWithoutPathExpansion( |
| (...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 941 MakeKioskApp("App Name", "1.0", kNoneAutoLaucnhedAppId, | 941 MakeKioskApp("App Name", "1.0", kNoneAutoLaucnhedAppId, |
| 942 kTestCases[i].required_platform_version); | 942 kTestCases[i].required_platform_version); |
| 943 EXPECT_TRUE(manager()->IsPlatformCompliantWithApp(app.get())) | 943 EXPECT_TRUE(manager()->IsPlatformCompliantWithApp(app.get())) |
| 944 << "Test case for non auto launch app: " << i | 944 << "Test case for non auto launch app: " << i |
| 945 << ", required_platform_version=" | 945 << ", required_platform_version=" |
| 946 << kTestCases[i].required_platform_version; | 946 << kTestCases[i].required_platform_version; |
| 947 } | 947 } |
| 948 } | 948 } |
| 949 | 949 |
| 950 } // namespace chromeos | 950 } // namespace chromeos |
| OLD | NEW |