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 |
11 #include "base/files/file_util.h" | 11 #include "base/files/file_util.h" |
12 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
13 #include "base/metrics/histogram_macros.h" | 13 #include "base/metrics/histogram_macros.h" |
14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
15 #include "base/task_scheduler/post_task.h" | 15 #include "base/task_scheduler/post_task.h" |
| 16 #include "base/values.h" |
16 #include "chrome/browser/chromeos/arc/arc_session_manager.h" | 17 #include "chrome/browser/chromeos/arc/arc_session_manager.h" |
17 #include "chrome/browser/chromeos/arc/arc_util.h" | 18 #include "chrome/browser/chromeos/arc/arc_util.h" |
18 #include "chrome/browser/chromeos/arc/policy/arc_policy_util.h" | 19 #include "chrome/browser/chromeos/arc/policy/arc_policy_util.h" |
19 #include "chrome/browser/profiles/profile.h" | 20 #include "chrome/browser/profiles/profile.h" |
20 #include "chrome/browser/ui/app_list/app_list_service.h" | 21 #include "chrome/browser/ui/app_list/app_list_service.h" |
21 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs_factory.h" | 22 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs_factory.h" |
22 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" | 23 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" |
23 #include "chrome/browser/ui/app_list/arc/arc_package_syncable_service.h" | 24 #include "chrome/browser/ui/app_list/arc/arc_package_syncable_service.h" |
24 #include "chrome/common/pref_names.h" | 25 #include "chrome/common/pref_names.h" |
25 #include "chrome/grit/generated_resources.h" | 26 #include "chrome/grit/generated_resources.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 const std::string& path) | 65 const std::string& path) |
65 : DictionaryPrefUpdate(service, path), id_(id) {} | 66 : DictionaryPrefUpdate(service, path), id_(id) {} |
66 | 67 |
67 ~ScopedArcPrefUpdate() override {} | 68 ~ScopedArcPrefUpdate() override {} |
68 | 69 |
69 // DictionaryPrefUpdate overrides: | 70 // DictionaryPrefUpdate overrides: |
70 base::DictionaryValue* Get() override { | 71 base::DictionaryValue* Get() override { |
71 base::DictionaryValue* dict = DictionaryPrefUpdate::Get(); | 72 base::DictionaryValue* dict = DictionaryPrefUpdate::Get(); |
72 base::DictionaryValue* dict_item = nullptr; | 73 base::DictionaryValue* dict_item = nullptr; |
73 if (!dict->GetDictionaryWithoutPathExpansion(id_, &dict_item)) { | 74 if (!dict->GetDictionaryWithoutPathExpansion(id_, &dict_item)) { |
74 dict_item = new base::DictionaryValue(); | 75 dict_item = dict->SetDictionaryWithoutPathExpansion( |
75 dict->SetWithoutPathExpansion(id_, dict_item); | 76 id_, base::MakeUnique<base::DictionaryValue>()); |
76 } | 77 } |
77 return dict_item; | 78 return dict_item; |
78 } | 79 } |
79 | 80 |
80 private: | 81 private: |
81 const std::string id_; | 82 const std::string id_; |
82 | 83 |
83 DISALLOW_COPY_AND_ASSIGN(ScopedArcPrefUpdate); | 84 DISALLOW_COPY_AND_ASSIGN(ScopedArcPrefUpdate); |
84 }; | 85 }; |
85 | 86 |
(...skipping 1349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1435 int64_t last_backup_android_id, | 1436 int64_t last_backup_android_id, |
1436 int64_t last_backup_time, | 1437 int64_t last_backup_time, |
1437 bool should_sync, | 1438 bool should_sync, |
1438 bool system) | 1439 bool system) |
1439 : package_name(package_name), | 1440 : package_name(package_name), |
1440 package_version(package_version), | 1441 package_version(package_version), |
1441 last_backup_android_id(last_backup_android_id), | 1442 last_backup_android_id(last_backup_android_id), |
1442 last_backup_time(last_backup_time), | 1443 last_backup_time(last_backup_time), |
1443 should_sync(should_sync), | 1444 should_sync(should_sync), |
1444 system(system) {} | 1445 system(system) {} |
OLD | NEW |