Chromium Code Reviews| 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 ed2dabc7763b48137343fcc3cf7cbbe6febf79de..eca590785db9ee8caab347c54c659a82693f72de 100644 |
| --- a/chrome/browser/search/hotword_service_factory.cc |
| +++ b/chrome/browser/search/hotword_service_factory.cc |
| @@ -15,6 +15,10 @@ |
| #include "content/public/browser/browser_context.h" |
| #include "content/public/browser/browser_thread.h" |
| +#if defined(OS_CHROMEOS) |
| +#include "chromeos/audio/cras_audio_handler.h" |
| +#endif |
| + |
| using content::BrowserContext; |
| using content::BrowserThread; |
| @@ -43,10 +47,14 @@ bool HotwordServiceFactory::IsHotwordAllowed(BrowserContext* context) { |
| // static |
| bool HotwordServiceFactory::IsHotwordHardwareAvailable() { |
| - // TODO(rlp, dgreid): return has_hotword_hardware() |
| - // Fill in once the hardware has the correct interface implemented. |
| - // In the meantime, this function can be used to get other parts moving |
| - // based on a flag. |
| +#if defined(OS_CHROMEOS) |
| + chromeos::AudioDeviceList devices; |
| + chromeos::CrasAudioHandler::Get()->GetAudioDevices(&devices); |
| + for (size_t i = 0; i < devices.size(); ++i) { |
| + if (devices[i].type == chromeos::AUDIO_TYPE_AOKR) |
|
jennyz
2014/12/13 00:05:01
By the way, do you know if this device is an input
dgreid
2014/12/13 00:06:11
always input.
jennyz
2014/12/13 00:08:14
How about
DCHECK(devices[i].is_input)?
jennyz
2014/12/13 00:17:36
I think it makes more sense to DCHECK it is input
rpetterson
2014/12/13 00:56:27
Ah, got it. I got the lines confused before. Done.
|
| + return true; |
| + } |
| +#endif |
| CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| return command_line->HasSwitch(switches::kEnableExperimentalHotwordHardware); |
| } |