| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 | 74 |
| 75 void Refresh() { | 75 void Refresh() { |
| 76 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 76 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 77 // UMA opt-in can be checked only from the UI thread, so switch to that. | 77 // UMA opt-in can be checked only from the UI thread, so switch to that. |
| 78 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 78 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
| 79 base::Bind(&OptionalRequestInfo::CheckUMAAndGetHardwareInfo, this)); | 79 base::Bind(&OptionalRequestInfo::CheckUMAAndGetHardwareInfo, this)); |
| 80 } | 80 } |
| 81 | 81 |
| 82 void CheckUMAAndGetHardwareInfo() { | 82 void CheckUMAAndGetHardwareInfo() { |
| 83 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 83 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 84 // prefs::kMetricsReportingEnabled is not registered for OS_CHROMEOS. | 84 // metrics::prefs::kMetricsReportingEnabled is not registered for |
| 85 // OS_CHROMEOS. |
| 85 #if !defined(OS_CHROMEOS) | 86 #if !defined(OS_CHROMEOS) |
| 86 if (g_browser_process->local_state()->GetBoolean( | 87 if (g_browser_process->local_state()->GetBoolean( |
| 87 prefs::kMetricsReportingEnabled)) { | 88 metrics::prefs::kMetricsReportingEnabled)) { |
| 88 // Access potentially slow OS calls from the FILE thread. | 89 // Access potentially slow OS calls from the FILE thread. |
| 89 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 90 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
| 90 base::Bind(&OptionalRequestInfo::GetHardwareInfo, this)); | 91 base::Bind(&OptionalRequestInfo::GetHardwareInfo, this)); |
| 91 } | 92 } |
| 92 #endif | 93 #endif |
| 93 } | 94 } |
| 94 | 95 |
| 95 void GetHardwareInfo() { | 96 void GetHardwareInfo() { |
| 96 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 97 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
| 97 base::AutoLock lock(lock_); | 98 base::AutoLock lock(lock_); |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 // manifest would be checked for permission. | 434 // manifest would be checked for permission. |
| 434 allowed = true; | 435 allowed = true; |
| 435 check_permission = true; | 436 check_permission = true; |
| 436 } | 437 } |
| 437 | 438 |
| 438 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 439 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
| 439 base::Bind(callback, check_permission, allowed)); | 440 base::Bind(callback, check_permission, allowed)); |
| 440 } | 441 } |
| 441 | 442 |
| 442 } // namespace speech | 443 } // namespace speech |
| OLD | NEW |