OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/renderer_host/pepper/device_id_fetcher.h" | 5 #include "chrome/browser/renderer_host/pepper/device_id_fetcher.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 int unused = 0; | 56 int unused = 0; |
57 browser_host->GetRenderViewIDsForInstance(instance_, | 57 browser_host->GetRenderViewIDsForInstance(instance_, |
58 &process_id, | 58 &process_id, |
59 &unused); | 59 &unused); |
60 BrowserThread::PostTask( | 60 BrowserThread::PostTask( |
61 BrowserThread::UI, FROM_HERE, | 61 BrowserThread::UI, FROM_HERE, |
62 base::Bind(&DeviceIDFetcher::CheckPrefsOnUIThread, this, process_id)); | 62 base::Bind(&DeviceIDFetcher::CheckPrefsOnUIThread, this, process_id)); |
63 } | 63 } |
64 | 64 |
65 // static | 65 // static |
66 void DeviceIDFetcher::RegisterUserPrefs(PrefRegistrySyncable* prefs) { | 66 void DeviceIDFetcher::RegisterUserPrefs( |
| 67 user_prefs::PrefRegistrySyncable* prefs) { |
67 // TODO(wad): Once UI is connected, a final default can be set. At that point | 68 // TODO(wad): Once UI is connected, a final default can be set. At that point |
68 // change this pref from UNSYNCABLE to SYNCABLE. | 69 // change this pref from UNSYNCABLE to SYNCABLE. |
69 prefs->RegisterBooleanPref(prefs::kEnableDRM, true, | 70 prefs->RegisterBooleanPref(prefs::kEnableDRM, |
70 PrefRegistrySyncable::UNSYNCABLE_PREF); | 71 true, |
71 prefs->RegisterStringPref(prefs::kDRMSalt, "", | 72 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
72 PrefRegistrySyncable::UNSYNCABLE_PREF); | 73 prefs->RegisterStringPref( |
| 74 prefs::kDRMSalt, |
| 75 "", |
| 76 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
73 } | 77 } |
74 | 78 |
75 // static | 79 // static |
76 base::FilePath DeviceIDFetcher::GetLegacyDeviceIDPath( | 80 base::FilePath DeviceIDFetcher::GetLegacyDeviceIDPath( |
77 const base::FilePath& profile_path) { | 81 const base::FilePath& profile_path) { |
78 return profile_path.AppendASCII(kDRMIdentifierFile); | 82 return profile_path.AppendASCII(kDRMIdentifierFile); |
79 } | 83 } |
80 | 84 |
81 // TODO(raymes): Change this to just return the device id salt and call it with | 85 // TODO(raymes): Change this to just return the device id salt and call it with |
82 // PostTaskAndReply once the legacy ChromeOS codepath is removed. | 86 // PostTaskAndReply once the legacy ChromeOS codepath is removed. |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 chromeos::CryptohomeLibrary* c_home = chromeos::CryptohomeLibrary::Get(); | 199 chromeos::CryptohomeLibrary* c_home = chromeos::CryptohomeLibrary::Get(); |
196 return c_home->GetSystemSalt(); | 200 return c_home->GetSystemSalt(); |
197 #else | 201 #else |
198 // Not implemented for other platforms. | 202 // Not implemented for other platforms. |
199 NOTREACHED(); | 203 NOTREACHED(); |
200 return ""; | 204 return ""; |
201 #endif | 205 #endif |
202 } | 206 } |
203 | 207 |
204 } // namespace chrome | 208 } // namespace chrome |
OLD | NEW |