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

Unified Diff: chrome/browser/search/hotword_service_factory.cc

Issue 1047973003: Notify hotwording extension of microphone state change. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 8 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
« no previous file with comments | « chrome/browser/search/hotword_service_factory.h ('k') | chrome/browser/ui/webui/voice_search_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/search/hotword_service_factory.cc
diff --git a/chrome/browser/search/hotword_service_factory.cc b/chrome/browser/search/hotword_service_factory.cc
index 4baf2be25e4004ada815974f654edd323f0cc4c0..1aa72ac258af6fefc989411bca8b1360bb83ad63 100644
--- a/chrome/browser/search/hotword_service_factory.cc
+++ b/chrome/browser/search/hotword_service_factory.cc
@@ -59,45 +59,16 @@ int HotwordServiceFactory::GetCurrentError(BrowserContext* context) {
return hotword_service->error_message();
}
-// static
-bool HotwordServiceFactory::IsMicrophoneAvailable() {
- return GetInstance()->microphone_available();
-}
-
-// static
-bool HotwordServiceFactory::IsAudioDeviceStateUpdated() {
- return GetInstance()->audio_device_state_updated();
-}
-
HotwordServiceFactory::HotwordServiceFactory()
: BrowserContextKeyedServiceFactory(
"HotwordService",
- BrowserContextDependencyManager::GetInstance()),
- microphone_available_(false),
- audio_device_state_updated_(false) {
+ BrowserContextDependencyManager::GetInstance()) {
// No dependencies.
-
- // Register with the device observer list to update the microphone
- // availability.
- BrowserThread::PostTask(
- BrowserThread::UI, FROM_HERE,
- base::Bind(&HotwordServiceFactory::InitializeMicrophoneObserver,
- base::Unretained(this)));
}
HotwordServiceFactory::~HotwordServiceFactory() {
}
-void HotwordServiceFactory::InitializeMicrophoneObserver() {
- MediaCaptureDevicesDispatcher::GetInstance()->AddObserver(this);
-}
-
-void HotwordServiceFactory::OnUpdateAudioDevices(
- const content::MediaStreamDevices& devices) {
- microphone_available_ = !devices.empty();
- audio_device_state_updated_ = true;
-}
-
void HotwordServiceFactory::UpdateMicrophoneState() {
// In order to trigger the monitor, just call getAudioCaptureDevices.
content::MediaStreamDevices devices =
« no previous file with comments | « chrome/browser/search/hotword_service_factory.h ('k') | chrome/browser/ui/webui/voice_search_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698