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

Unified Diff: chrome/browser/speech/speech_input_extension_manager.cc

Issue 8818012: Remove the AudioManager singleton. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Set svn eol properties for a couple of files Created 9 years 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
« no previous file with comments | « chrome/browser/speech/speech_input_bubble_views.cc ('k') | chrome/test/base/testing_browser_process.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/speech/speech_input_extension_manager.cc
===================================================================
--- chrome/browser/speech/speech_input_extension_manager.cc (revision 114012)
+++ 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();
}
« no previous file with comments | « chrome/browser/speech/speech_input_bubble_views.cc ('k') | chrome/test/base/testing_browser_process.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698