OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/extensions/api/music_manager_private/device_id.h" | 5 #include "chrome/browser/extensions/api/music_manager_private/device_id.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 } | 167 } |
168 } | 168 } |
169 return true; | 169 return true; |
170 } | 170 } |
171 | 171 |
172 } // namespace | 172 } // namespace |
173 | 173 |
174 namespace extensions { | 174 namespace extensions { |
175 namespace api { | 175 namespace api { |
176 | 176 |
| 177 #if defined(OS_ANDROID) |
| 178 // static |
| 179 void DeviceId::GetRawDeviceId(const base::Callback<void(const std::string&)>& ca
llback) { |
| 180 callback.Run(""); |
| 181 } |
| 182 #endif |
| 183 |
177 // static | 184 // static |
178 void DeviceId::GetDeviceId(const std::string& extension_id, | 185 void DeviceId::GetDeviceId(const std::string& extension_id, |
179 const IdCallback& callback) { | 186 const IdCallback& callback) { |
180 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 187 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
181 CHECK(!extension_id.empty()); | 188 CHECK(!extension_id.empty()); |
182 | 189 |
183 // Forward call to platform specific implementation, then compute the HMAC | 190 // Forward call to platform specific implementation, then compute the HMAC |
184 // in the callback. | 191 // in the callback. |
185 GetRawDeviceId(base::Bind(&GetRawDeviceIdCallback, extension_id, callback)); | 192 GetRawDeviceId(base::Bind(&GetRawDeviceIdCallback, extension_id, callback)); |
186 } | 193 } |
187 | 194 |
188 // static | 195 // static |
189 bool DeviceId::IsValidMacAddress(const void* bytes, size_t size) { | 196 bool DeviceId::IsValidMacAddress(const void* bytes, size_t size) { |
190 return IsValidMacAddressImpl(bytes, size); | 197 return IsValidMacAddressImpl(bytes, size); |
191 } | 198 } |
192 | 199 |
193 } // namespace api | 200 } // namespace api |
194 } // namespace extensions | 201 } // namespace extensions |
OLD | NEW |