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

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

Issue 9433006: Remove GetAudioManager and GetMediaStreamManager from ResourceContext. The reason is the content mo… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: review comments Created 8 years, 10 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: chrome/browser/speech/chrome_speech_input_manager.cc
===================================================================
--- chrome/browser/speech/chrome_speech_input_manager.cc (revision 123165)
+++ chrome/browser/speech/chrome_speech_input_manager.cc (working copy)
@@ -19,7 +19,6 @@
#include "content/public/browser/resource_context.h"
#include "content/public/common/speech_input_result.h"
#include "grit/generated_resources.h"
-#include "media/audio/audio_manager.h"
#include "ui/base/l10n/l10n_util.h"
#if defined(OS_WIN)
@@ -37,9 +36,7 @@
class ChromeSpeechInputManager::OptionalRequestInfo
: public base::RefCountedThreadSafe<OptionalRequestInfo> {
public:
- explicit OptionalRequestInfo(AudioManager* audio_manager)
- : can_report_metrics_(false), audio_manager_(audio_manager) {
- DCHECK(audio_manager_); // Fail early.
+ OptionalRequestInfo() : can_report_metrics_(false) {
}
void Refresh() {
@@ -63,13 +60,13 @@
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
base::AutoLock lock(lock_);
can_report_metrics_ = true;
+ string16 device_model =
+ ChromeSpeechInputManager::GetInstance()->GetAudioInputDeviceModel();
#if defined(OS_WIN)
value_ = UTF16ToUTF8(
- installer::WMIComputerSystem::GetModel() + L"|" +
- audio_manager_->GetAudioInputDeviceModel());
+ installer::WMIComputerSystem::GetModel() + L"|" + device_model);
#else // defined(OS_WIN)
- value_ = UTF16ToUTF8(
- audio_manager_->GetAudioInputDeviceModel());
+ value_ = UTF16ToUTF8(device_model);
#endif // defined(OS_WIN)
}
@@ -91,7 +88,6 @@
base::Lock lock_;
std::string value_;
bool can_report_metrics_;
- AudioManager* audio_manager_;
DISALLOW_COPY_AND_ASSIGN(OptionalRequestInfo);
};
@@ -118,12 +114,11 @@
}
void ChromeSpeechInputManager::GetRequestInfo(
- AudioManager* audio_manager,
bool* can_report_metrics,
std::string* request_info) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (!optional_request_info_.get()) {
- optional_request_info_ = new OptionalRequestInfo(audio_manager);
+ optional_request_info_ = new OptionalRequestInfo();
// Since hardware info is optional with speech input requests, we start an
// asynchronous fetch here and move on with recording audio. This first
// speech input request would send an empty string for hardware info and
« no previous file with comments | « chrome/browser/speech/chrome_speech_input_manager.h ('k') | chrome/browser/speech/speech_input_bubble_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698