OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/ui/app_list/arc/arc_app_list_prefs.h" | 5 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 package->GetBoolean(kShouldSync, &should_sync); | 411 package->GetBoolean(kShouldSync, &should_sync); |
412 package->GetBoolean(kSystem, &system); | 412 package->GetBoolean(kSystem, &system); |
413 | 413 |
414 return base::MakeUnique<PackageInfo>(package_name, package_version, | 414 return base::MakeUnique<PackageInfo>(package_name, package_version, |
415 last_backup_android_id, last_backup_time, | 415 last_backup_android_id, last_backup_time, |
416 should_sync, system); | 416 should_sync, system); |
417 } | 417 } |
418 | 418 |
419 std::vector<std::string> ArcAppListPrefs::GetAppIds() const { | 419 std::vector<std::string> ArcAppListPrefs::GetAppIds() const { |
420 if (!IsArcEnabled()) { | 420 if (!IsArcEnabled()) { |
421 // Default Arc apps available before OptIn. | 421 // Default ARC apps available before OptIn. |
422 std::vector<std::string> ids; | 422 std::vector<std::string> ids; |
423 for (const auto& default_app : default_apps_.app_map()) { | 423 for (const auto& default_app : default_apps_.app_map()) { |
424 if (default_apps_.HasApp(default_app.first)) | 424 if (default_apps_.HasApp(default_app.first)) |
425 ids.push_back(default_app.first); | 425 ids.push_back(default_app.first); |
426 } | 426 } |
427 return ids; | 427 return ids; |
428 } | 428 } |
429 return GetAppIdsNoArcEnabledCheck(); | 429 return GetAppIdsNoArcEnabledCheck(); |
430 } | 430 } |
431 | 431 |
(...skipping 10 matching lines...) Expand all Loading... |
442 continue; | 442 continue; |
443 | 443 |
444 ids.push_back(app_id.key()); | 444 ids.push_back(app_id.key()); |
445 } | 445 } |
446 | 446 |
447 return ids; | 447 return ids; |
448 } | 448 } |
449 | 449 |
450 std::unique_ptr<ArcAppListPrefs::AppInfo> ArcAppListPrefs::GetApp( | 450 std::unique_ptr<ArcAppListPrefs::AppInfo> ArcAppListPrefs::GetApp( |
451 const std::string& app_id) const { | 451 const std::string& app_id) const { |
452 // Information for default app is available before Arc enabled. | 452 // Information for default app is available before ARC enabled. |
453 if (!IsArcEnabled() && !default_apps_.HasApp(app_id)) | 453 if (!IsArcEnabled() && !default_apps_.HasApp(app_id)) |
454 return std::unique_ptr<AppInfo>(); | 454 return std::unique_ptr<AppInfo>(); |
455 | 455 |
456 const base::DictionaryValue* app = nullptr; | 456 const base::DictionaryValue* app = nullptr; |
457 const base::DictionaryValue* apps = prefs_->GetDictionary(prefs::kArcApps); | 457 const base::DictionaryValue* apps = prefs_->GetDictionary(prefs::kArcApps); |
458 if (!apps || !apps->GetDictionaryWithoutPathExpansion(app_id, &app)) | 458 if (!apps || !apps->GetDictionaryWithoutPathExpansion(app_id, &app)) |
459 return std::unique_ptr<AppInfo>(); | 459 return std::unique_ptr<AppInfo>(); |
460 | 460 |
461 std::string name; | 461 std::string name; |
462 std::string package_name; | 462 std::string package_name; |
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1357 int64_t last_backup_android_id, | 1357 int64_t last_backup_android_id, |
1358 int64_t last_backup_time, | 1358 int64_t last_backup_time, |
1359 bool should_sync, | 1359 bool should_sync, |
1360 bool system) | 1360 bool system) |
1361 : package_name(package_name), | 1361 : package_name(package_name), |
1362 package_version(package_version), | 1362 package_version(package_version), |
1363 last_backup_android_id(last_backup_android_id), | 1363 last_backup_android_id(last_backup_android_id), |
1364 last_backup_time(last_backup_time), | 1364 last_backup_time(last_backup_time), |
1365 should_sync(should_sync), | 1365 should_sync(should_sync), |
1366 system(system) {} | 1366 system(system) {} |
OLD | NEW |