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); |
56 | 58 |
57 RegisterPlatformPrefs(registry); | 59 RegisterPlatformPrefs(registry); |
58 | 60 |
59 PrefServiceFactory prefServiceFactory; | 61 PrefServiceFactory prefServiceFactory; |
60 scoped_refptr<base::SequencedTaskRunner> task_runner = | 62 scoped_refptr<base::SequencedTaskRunner> task_runner = |
61 JsonPrefStore::GetTaskRunnerForFile( | 63 JsonPrefStore::GetTaskRunnerForFile( |
62 config_path, | 64 config_path, |
63 content::BrowserThread::GetBlockingPool()); | 65 content::BrowserThread::GetBlockingPool()); |
64 prefServiceFactory.SetUserPrefsFile(config_path, task_runner.get()); | 66 prefServiceFactory.SetUserPrefsFile(config_path, task_runner.get()); |
65 prefServiceFactory.set_async(false); | 67 prefServiceFactory.set_async(false); |
(...skipping 10 matching lines...) Expand all Loading... |
76 << config_path.value() | 78 << config_path.value() |
77 << ", pref_error=" << prefs_read_error; | 79 << ", pref_error=" << prefs_read_error; |
78 } | 80 } |
79 | 81 |
80 OnPrefsLoaded(pref_service.get()); | 82 OnPrefsLoaded(pref_service.get()); |
81 return pref_service; | 83 return pref_service; |
82 } | 84 } |
83 | 85 |
84 } // namespace shell | 86 } // namespace shell |
85 } // namespace chromecast | 87 } // namespace chromecast |
OLD | NEW |