Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1485)

Unified Diff: content/browser/speech/input_tag_speech_dispatcher_host.cc

Issue 10399025: Moved instantiation of SpeechRecognitionManager inside browser_main_loop, instead of Singleton. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed FakeSpeechRecognitionManager. Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/speech/input_tag_speech_dispatcher_host.cc
diff --git a/content/browser/speech/input_tag_speech_dispatcher_host.cc b/content/browser/speech/input_tag_speech_dispatcher_host.cc
index 2482f714c7c9347544f78f8029b6aa85f2986f47..ccda4caff28bd8306d437b4a3d1e0d8013e64cd7 100644
--- a/content/browser/speech/input_tag_speech_dispatcher_host.cc
+++ b/content/browser/speech/input_tag_speech_dispatcher_host.cc
@@ -29,11 +29,12 @@ bool IsSameContext(int render_process_id,
} // namespace
namespace speech {
-SpeechRecognitionManagerImpl* InputTagSpeechDispatcherHost::manager_;
+content::SpeechRecognitionManager*
hans 2012/05/15 15:32:31 a "using content::SpeechRecognitionManager" at the
Primiano Tucci (use gerrit) 2012/05/15 16:04:03 Done.
+InputTagSpeechDispatcherHost::manager_for_tests_;
-void InputTagSpeechDispatcherHost::set_manager(
- SpeechRecognitionManagerImpl* manager) {
- manager_ = manager;
+void InputTagSpeechDispatcherHost::set_manager_for_tests(
+ content::SpeechRecognitionManager* manager) {
+ manager_for_tests_ = manager;
}
InputTagSpeechDispatcherHost::InputTagSpeechDispatcherHost(
@@ -59,11 +60,11 @@ InputTagSpeechDispatcherHost::~InputTagSpeechDispatcherHost() {
manager()->AbortAllSessionsForListener(this);
}
-SpeechRecognitionManagerImpl* InputTagSpeechDispatcherHost::manager() {
- if (manager_)
- return manager_;
+content::SpeechRecognitionManager* InputTagSpeechDispatcherHost::manager() {
+ if (manager_for_tests_)
+ return manager_for_tests_;
#if defined(ENABLE_INPUT_SPEECH)
- return SpeechRecognitionManagerImpl::GetInstance();
+ return content::SpeechRecognitionManager::GetInstance();
#else
return NULL;
#endif

Powered by Google App Engine
This is Rietveld 408576698