| Index: chrome/browser/speech/speech_input_extension_manager.cc
|
| ===================================================================
|
| --- chrome/browser/speech/speech_input_extension_manager.cc (revision 113173)
|
| +++ chrome/browser/speech/speech_input_extension_manager.cc (working copy)
|
| @@ -19,12 +19,13 @@
|
| #include "chrome/common/chrome_notification_types.h"
|
| #include "chrome/common/extensions/extension.h"
|
| #include "chrome/common/pref_names.h"
|
| +#include "content/browser/resource_context.h"
|
| #include "content/public/browser/browser_thread.h"
|
| #include "content/public/browser/notification_service.h"
|
| #include "content/public/common/speech_input_result.h"
|
|
|
| using content::BrowserThread;
|
| -using namespace speech_input;
|
| +using speech_input::SpeechRecognizer;
|
|
|
| namespace {
|
|
|
| @@ -74,7 +75,6 @@
|
|
|
| scoped_refptr<SpeechInputExtensionManager> manager_;
|
| };
|
| -
|
| }
|
|
|
| // Factory for SpeechInputExtensionManagers as profile keyed services.
|
| @@ -151,7 +151,7 @@
|
|
|
| SpeechInputExtensionManager* SpeechInputExtensionManager::GetForProfile(
|
| Profile* profile) {
|
| - SpeechInputExtensionManagerWrapper *wrapper =
|
| + SpeechInputExtensionManagerWrapper* wrapper =
|
| Factory::GetInstance()->GetForProfile(profile);
|
| if (!wrapper)
|
| return NULL;
|
| @@ -462,7 +462,7 @@
|
| // Used for errors that are also reported via the onError event.
|
| if (dispatch_event) {
|
| ListValue args;
|
| - DictionaryValue *js_error = new DictionaryValue();
|
| + DictionaryValue* js_error = new DictionaryValue();
|
| args.Append(js_error);
|
| js_error->SetString(kErrorCodeKey, error);
|
| std::string json_args;
|
| @@ -546,12 +546,12 @@
|
| }
|
|
|
| bool SpeechInputExtensionManager::HasAudioInputDevices() {
|
| - return AudioManager::GetAudioManager()->HasAudioInputDevices();
|
| + return profile_->GetResourceContext().audio_manager()->HasAudioInputDevices();
|
| }
|
|
|
| bool SpeechInputExtensionManager::IsRecordingInProcess() {
|
| // Thread-safe query.
|
| - return AudioManager::GetAudioManager()->IsRecordingInProcess();
|
| + return profile_->GetResourceContext().audio_manager()->IsRecordingInProcess();
|
| }
|
|
|
| bool SpeechInputExtensionManager::IsRecording() {
|
| @@ -565,7 +565,8 @@
|
| bool filter_profanities) {
|
| DCHECK(!recognizer_);
|
| recognizer_ = new SpeechRecognizer(delegate, caller_id, language, grammar,
|
| - context_getter, filter_profanities, "", "");
|
| + context_getter, profile_->GetResourceContext().audio_manager(),
|
| + filter_profanities, "", "");
|
| recognizer_->StartRecording();
|
| }
|
|
|
|
|