OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "services/preferences/public/cpp/preferences_struct_traits.h" | 5 #include "services/preferences/public/cpp/preferences_struct_traits.h" |
6 | 6 |
7 namespace mojo { | 7 namespace mojo { |
8 | 8 |
9 using PrefStoreType = prefs::mojom::PrefStoreType; | 9 using PrefStoreType = prefs::mojom::PrefStoreType; |
10 | 10 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 case PrefStoreType::RECOMMENDED: | 54 case PrefStoreType::RECOMMENDED: |
55 *output = PrefValueStore::RECOMMENDED_STORE; | 55 *output = PrefValueStore::RECOMMENDED_STORE; |
56 return true; | 56 return true; |
57 case PrefStoreType::DEFAULT: | 57 case PrefStoreType::DEFAULT: |
58 *output = PrefValueStore::DEFAULT_STORE; | 58 *output = PrefValueStore::DEFAULT_STORE; |
59 return true; | 59 return true; |
60 } | 60 } |
61 return false; | 61 return false; |
62 } | 62 } |
63 | 63 |
64 using MojomReadError = prefs::mojom::PersistentPrefStoreConnector_ReadError; | 64 using MojomReadError = prefs::mojom::PersistentPrefStoreConnection_ReadError; |
65 | 65 |
66 MojomReadError | 66 MojomReadError |
67 EnumTraits<MojomReadError, PersistentPrefStore::PrefReadError>::ToMojom( | 67 EnumTraits<MojomReadError, PersistentPrefStore::PrefReadError>::ToMojom( |
68 PersistentPrefStore::PrefReadError input) { | 68 PersistentPrefStore::PrefReadError input) { |
69 switch (input) { | 69 switch (input) { |
70 case PersistentPrefStore::PREF_READ_ERROR_NONE: | 70 case PersistentPrefStore::PREF_READ_ERROR_NONE: |
71 return MojomReadError::NONE; | 71 return MojomReadError::NONE; |
72 case PersistentPrefStore::PREF_READ_ERROR_JSON_PARSE: | 72 case PersistentPrefStore::PREF_READ_ERROR_JSON_PARSE: |
73 return MojomReadError::JSON_PARSE; | 73 return MojomReadError::JSON_PARSE; |
74 case PersistentPrefStore::PREF_READ_ERROR_JSON_TYPE: | 74 case PersistentPrefStore::PREF_READ_ERROR_JSON_TYPE: |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 return true; | 127 return true; |
128 case MojomReadError::ASYNCHRONOUS_TASK_INCOMPLETE: | 128 case MojomReadError::ASYNCHRONOUS_TASK_INCOMPLETE: |
129 *output = | 129 *output = |
130 PersistentPrefStore::PREF_READ_ERROR_ASYNCHRONOUS_TASK_INCOMPLETE; | 130 PersistentPrefStore::PREF_READ_ERROR_ASYNCHRONOUS_TASK_INCOMPLETE; |
131 return true; | 131 return true; |
132 } | 132 } |
133 return false; | 133 return false; |
134 } | 134 } |
135 | 135 |
136 } // namespace mojo | 136 } // namespace mojo |
OLD | NEW |