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 "content/public/test/fake_speech_recognition_manager.h" | 5 #include "content/public/test/fake_speech_recognition_manager.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "content/public/browser/speech_recognition_event_listener.h" | 10 #include "content/public/browser/speech_recognition_event_listener.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 did_cancel_all_ = true; | 108 did_cancel_all_ = true; |
109 } | 109 } |
110 | 110 |
111 void FakeSpeechRecognitionManager::AbortAllSessionsForRenderView( | 111 void FakeSpeechRecognitionManager::AbortAllSessionsForRenderView( |
112 int render_process_id, int render_view_id) { | 112 int render_process_id, int render_view_id) { |
113 NOTREACHED(); | 113 NOTREACHED(); |
114 } | 114 } |
115 | 115 |
116 bool FakeSpeechRecognitionManager::HasAudioInputDevices() { return true; } | 116 bool FakeSpeechRecognitionManager::HasAudioInputDevices() { return true; } |
117 | 117 |
118 string16 FakeSpeechRecognitionManager::GetAudioInputDeviceModel() { | 118 base::string16 FakeSpeechRecognitionManager::GetAudioInputDeviceModel() { |
119 return string16(); | 119 return base::string16(); |
120 } | 120 } |
121 | 121 |
122 int FakeSpeechRecognitionManager::GetSession(int render_process_id, | 122 int FakeSpeechRecognitionManager::GetSession(int render_process_id, |
123 int render_view_id, | 123 int render_view_id, |
124 int request_id) const { | 124 int request_id) const { |
125 return session_ctx_.render_process_id == render_process_id && | 125 return session_ctx_.render_process_id == render_process_id && |
126 session_ctx_.render_view_id == render_view_id && | 126 session_ctx_.render_view_id == render_view_id && |
127 session_ctx_.request_id == request_id; | 127 session_ctx_.request_id == request_id; |
128 } | 128 } |
129 | 129 |
(...skipping 21 matching lines...) Expand all Loading... |
151 SpeechRecognitionResults results; | 151 SpeechRecognitionResults results; |
152 results.push_back(result); | 152 results.push_back(result); |
153 listener_->OnRecognitionResults(session_id_, results); | 153 listener_->OnRecognitionResults(session_id_, results); |
154 listener_->OnRecognitionEnd(session_id_); | 154 listener_->OnRecognitionEnd(session_id_); |
155 session_id_ = 0; | 155 session_id_ = 0; |
156 listener_ = NULL; | 156 listener_ = NULL; |
157 VLOG(1) << "Finished setting fake recognition result."; | 157 VLOG(1) << "Finished setting fake recognition result."; |
158 } | 158 } |
159 | 159 |
160 } // namespace content | 160 } // namespace content |
OLD | NEW |