| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/speech_input_manager.h" | 5 #include "chrome/browser/speech/speech_input_manager.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 virtual ~SpeechInputManagerImpl(); | 128 virtual ~SpeechInputManagerImpl(); |
| 129 | 129 |
| 130 bool HasPendingRequest(int caller_id) const; | 130 bool HasPendingRequest(int caller_id) const; |
| 131 SpeechInputManagerDelegate* GetDelegate(int caller_id) const; | 131 SpeechInputManagerDelegate* GetDelegate(int caller_id) const; |
| 132 | 132 |
| 133 void CancelRecognitionAndInformDelegate(int caller_id); | 133 void CancelRecognitionAndInformDelegate(int caller_id); |
| 134 | 134 |
| 135 // Starts/restarts recognition for an existing request. | 135 // Starts/restarts recognition for an existing request. |
| 136 void StartRecognitionForRequest(int caller_id); | 136 void StartRecognitionForRequest(int caller_id); |
| 137 | 137 |
| 138 SpeechInputManagerDelegate* delegate_; | |
| 139 typedef std::map<int, SpeechInputRequest> SpeechRecognizerMap; | 138 typedef std::map<int, SpeechInputRequest> SpeechRecognizerMap; |
| 140 SpeechRecognizerMap requests_; | 139 SpeechRecognizerMap requests_; |
| 141 int recording_caller_id_; | 140 int recording_caller_id_; |
| 142 scoped_refptr<SpeechInputBubbleController> bubble_controller_; | 141 scoped_refptr<SpeechInputBubbleController> bubble_controller_; |
| 143 scoped_refptr<HardwareInfo> hardware_info_; | 142 scoped_refptr<HardwareInfo> hardware_info_; |
| 144 }; | 143 }; |
| 145 | 144 |
| 146 static ::base::LazyInstance<SpeechInputManagerImpl> g_speech_input_manager_impl( | 145 static ::base::LazyInstance<SpeechInputManagerImpl> g_speech_input_manager_impl( |
| 147 base::LINKER_INITIALIZED); | 146 base::LINKER_INITIALIZED); |
| 148 | 147 |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 // to the user, abort it since user has switched focus. Otherwise | 330 // to the user, abort it since user has switched focus. Otherwise |
| 332 // recognition has started and keep that going so user can start speaking to | 331 // recognition has started and keep that going so user can start speaking to |
| 333 // another element while this gets the results in parallel. | 332 // another element while this gets the results in parallel. |
| 334 if (recording_caller_id_ == caller_id || !requests_[caller_id].is_active) { | 333 if (recording_caller_id_ == caller_id || !requests_[caller_id].is_active) { |
| 335 CancelRecognitionAndInformDelegate(caller_id); | 334 CancelRecognitionAndInformDelegate(caller_id); |
| 336 } | 335 } |
| 337 } | 336 } |
| 338 } | 337 } |
| 339 | 338 |
| 340 } // namespace speech_input | 339 } // namespace speech_input |
| OLD | NEW |