| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/speech/chrome_speech_recognition_manager_delegate.h" | 5 #include "chrome/browser/speech/chrome_speech_recognition_manager_delegate.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 #endif | 92 #endif |
| 93 } | 93 } |
| 94 | 94 |
| 95 void GetHardwareInfo() { | 95 void GetHardwareInfo() { |
| 96 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 96 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
| 97 base::AutoLock lock(lock_); | 97 base::AutoLock lock(lock_); |
| 98 can_report_metrics_ = true; | 98 can_report_metrics_ = true; |
| 99 base::string16 device_model = | 99 base::string16 device_model = |
| 100 SpeechRecognitionManager::GetInstance()->GetAudioInputDeviceModel(); | 100 SpeechRecognitionManager::GetInstance()->GetAudioInputDeviceModel(); |
| 101 #if defined(OS_WIN) | 101 #if defined(OS_WIN) |
| 102 value_ = UTF16ToUTF8( | 102 value_ = base::UTF16ToUTF8( |
| 103 installer::WMIComputerSystem::GetModel() + L"|" + device_model); | 103 installer::WMIComputerSystem::GetModel() + L"|" + device_model); |
| 104 #else // defined(OS_WIN) | 104 #else // defined(OS_WIN) |
| 105 value_ = UTF16ToUTF8(device_model); | 105 value_ = base::UTF16ToUTF8(device_model); |
| 106 #endif // defined(OS_WIN) | 106 #endif // defined(OS_WIN) |
| 107 } | 107 } |
| 108 | 108 |
| 109 std::string value() { | 109 std::string value() { |
| 110 base::AutoLock lock(lock_); | 110 base::AutoLock lock(lock_); |
| 111 return value_; | 111 return value_; |
| 112 } | 112 } |
| 113 | 113 |
| 114 bool can_report_metrics() { | 114 bool can_report_metrics() { |
| 115 base::AutoLock lock(lock_); | 115 base::AutoLock lock(lock_); |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 allowed = true; | 456 allowed = true; |
| 457 if (js_api) | 457 if (js_api) |
| 458 check_permission = true; | 458 check_permission = true; |
| 459 } | 459 } |
| 460 | 460 |
| 461 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 461 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
| 462 base::Bind(callback, check_permission, allowed)); | 462 base::Bind(callback, check_permission, allowed)); |
| 463 } | 463 } |
| 464 | 464 |
| 465 } // namespace speech | 465 } // namespace speech |
| OLD | NEW |