| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chromecast/browser/pref_service_helper.h" | 5 #include "chromecast/browser/pref_service_helper.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 registry->RegisterBooleanPref(prefs::kEnableRemoteDebugging, false); | 46 registry->RegisterBooleanPref(prefs::kEnableRemoteDebugging, false); |
| 47 registry->RegisterBooleanPref(prefs::kMetricsIsNewClientID, false); | 47 registry->RegisterBooleanPref(prefs::kMetricsIsNewClientID, false); |
| 48 // Opt-in stats default to true to handle two different cases: | 48 // Opt-in stats default to true to handle two different cases: |
| 49 // 1) Any crashes or UMA logs are recorded prior to setup completing | 49 // 1) Any crashes or UMA logs are recorded prior to setup completing |
| 50 // successfully (even though we can't send them yet). Unless the user | 50 // successfully (even though we can't send them yet). Unless the user |
| 51 // ends up actually opting out, we don't want to lose this data once | 51 // ends up actually opting out, we don't want to lose this data once |
| 52 // we get network connectivity and are able to send it. If the user | 52 // we get network connectivity and are able to send it. If the user |
| 53 // opts out, nothing further will be sent (honoring the user's setting). | 53 // opts out, nothing further will be sent (honoring the user's setting). |
| 54 // 2) Dogfood users (see dogfood agreement). | 54 // 2) Dogfood users (see dogfood agreement). |
| 55 registry->RegisterBooleanPref(prefs::kOptInStats, true); | 55 registry->RegisterBooleanPref(prefs::kOptInStats, true); |
| 56 registry->RegisterListPref(prefs::kActiveDCSExperiments); | |
| 57 registry->RegisterDictionaryPref(prefs::kLatestDCSFeatures); | |
| 58 | 56 |
| 59 RegisterPlatformPrefs(registry); | 57 RegisterPlatformPrefs(registry); |
| 60 | 58 |
| 61 PrefServiceFactory prefServiceFactory; | 59 PrefServiceFactory prefServiceFactory; |
| 62 scoped_refptr<base::SequencedTaskRunner> task_runner = | 60 scoped_refptr<base::SequencedTaskRunner> task_runner = |
| 63 JsonPrefStore::GetTaskRunnerForFile( | 61 JsonPrefStore::GetTaskRunnerForFile( |
| 64 config_path, | 62 config_path, |
| 65 content::BrowserThread::GetBlockingPool()); | 63 content::BrowserThread::GetBlockingPool()); |
| 66 prefServiceFactory.SetUserPrefsFile(config_path, task_runner.get()); | 64 prefServiceFactory.SetUserPrefsFile(config_path, task_runner.get()); |
| 67 prefServiceFactory.set_async(false); | 65 prefServiceFactory.set_async(false); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 78 << config_path.value() | 76 << config_path.value() |
| 79 << ", pref_error=" << prefs_read_error; | 77 << ", pref_error=" << prefs_read_error; |
| 80 } | 78 } |
| 81 | 79 |
| 82 OnPrefsLoaded(pref_service.get()); | 80 OnPrefsLoaded(pref_service.get()); |
| 83 return pref_service; | 81 return pref_service; |
| 84 } | 82 } |
| 85 | 83 |
| 86 } // namespace shell | 84 } // namespace shell |
| 87 } // namespace chromecast | 85 } // namespace chromecast |
| OLD | NEW |