| 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 "extensions/shell/browser/shell_speech_recognition_manager_delegate.h" | 5 #include "extensions/shell/browser/shell_speech_recognition_manager_delegate.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "content/public/browser/browser_thread.h" | 8 #include "content/public/browser/browser_thread.h" |
| 9 #include "content/public/browser/render_view_host.h" | 9 #include "content/public/browser/render_view_host.h" |
| 10 #include "content/public/browser/speech_recognition_manager.h" | 10 #include "content/public/browser/speech_recognition_manager.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 int session_id, | 57 int session_id, |
| 58 const content::SpeechRecognitionError& error) { | 58 const content::SpeechRecognitionError& error) { |
| 59 } | 59 } |
| 60 | 60 |
| 61 void ShellSpeechRecognitionManagerDelegate::OnAudioLevelsChange( | 61 void ShellSpeechRecognitionManagerDelegate::OnAudioLevelsChange( |
| 62 int session_id, | 62 int session_id, |
| 63 float volume, | 63 float volume, |
| 64 float noise_volume) { | 64 float noise_volume) { |
| 65 } | 65 } |
| 66 | 66 |
| 67 void ShellSpeechRecognitionManagerDelegate::GetDiagnosticInformation( | |
| 68 bool* can_report_metrics, | |
| 69 std::string* hardware_info) { | |
| 70 } | |
| 71 | |
| 72 void ShellSpeechRecognitionManagerDelegate::CheckRecognitionIsAllowed( | 67 void ShellSpeechRecognitionManagerDelegate::CheckRecognitionIsAllowed( |
| 73 int session_id, | 68 int session_id, |
| 74 base::Callback<void(bool ask_user, bool is_allowed)> callback) { | 69 base::Callback<void(bool ask_user, bool is_allowed)> callback) { |
| 75 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 70 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 76 | 71 |
| 77 const content::SpeechRecognitionSessionContext& context = | 72 const content::SpeechRecognitionSessionContext& context = |
| 78 SpeechRecognitionManager::GetInstance()->GetSessionContext(session_id); | 73 SpeechRecognitionManager::GetInstance()->GetSessionContext(session_id); |
| 79 | 74 |
| 80 // Make sure that initiators (extensions/web pages) properly set the | 75 // Make sure that initiators (extensions/web pages) properly set the |
| 81 // |render_process_id| field, which is needed later to retrieve the profile. | 76 // |render_process_id| field, which is needed later to retrieve the profile. |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 LOG(WARNING) << "Speech recognition only supported in Apps."; | 118 LOG(WARNING) << "Speech recognition only supported in Apps."; |
| 124 } | 119 } |
| 125 } | 120 } |
| 126 | 121 |
| 127 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 122 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
| 128 base::Bind(callback, check_permission, allowed)); | 123 base::Bind(callback, check_permission, allowed)); |
| 129 } | 124 } |
| 130 | 125 |
| 131 } // namespace speech | 126 } // namespace speech |
| 132 } // namespace extensions | 127 } // namespace extensions |
| OLD | NEW |