| OLD | NEW | 
|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/profiles/profile_statistics_aggregator.h" | 5 #include "chrome/browser/profiles/profile_statistics_aggregator.h" | 
| 6 | 6 | 
| 7 #include <stddef.h> | 7 #include <stddef.h> | 
| 8 | 8 | 
| 9 #include "base/bind.h" | 9 #include "base/bind.h" | 
| 10 #include "base/macros.h" | 10 #include "base/macros.h" | 
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 218   if (pref_service) { | 218   if (pref_service) { | 
| 219     std::unique_ptr<base::DictionaryValue> prefs = | 219     std::unique_ptr<base::DictionaryValue> prefs = | 
| 220         pref_service->GetPreferenceValuesWithoutPathExpansion(); | 220         pref_service->GetPreferenceValuesWithoutPathExpansion(); | 
| 221 | 221 | 
| 222     int count = 0; | 222     int count = 0; | 
| 223     for (base::DictionaryValue::Iterator it(*(prefs.get())); | 223     for (base::DictionaryValue::Iterator it(*(prefs.get())); | 
| 224          !it.IsAtEnd(); it.Advance()) { | 224          !it.IsAtEnd(); it.Advance()) { | 
| 225       const PrefService::Preference* pref = pref_service-> | 225       const PrefService::Preference* pref = pref_service-> | 
| 226                                                 FindPreference(it.key()); | 226                                                 FindPreference(it.key()); | 
| 227       // Skip all dictionaries (which must be empty by the function call above). | 227       // Skip all dictionaries (which must be empty by the function call above). | 
| 228       if (it.value().GetType() != base::Value::TYPE_DICTIONARY && | 228       if (it.value().GetType() != base::Value::Type::DICTIONARY && | 
| 229         pref && pref->IsUserControlled() && !pref->IsDefaultValue()) { | 229         pref && pref->IsUserControlled() && !pref->IsDefaultValue()) { | 
| 230         ++count; | 230         ++count; | 
| 231       } | 231       } | 
| 232     } | 232     } | 
| 233 | 233 | 
| 234     result.count = count; | 234     result.count = count; | 
| 235     result.success = true; | 235     result.success = true; | 
| 236   } else { | 236   } else { | 
| 237     result.count = 0; | 237     result.count = 0; | 
| 238     result.success = false; | 238     result.success = false; | 
| 239   } | 239   } | 
| 240   return result; | 240   return result; | 
| 241 } | 241 } | 
| OLD | NEW | 
|---|