[Hotword] Delay checking for audio devices until needed.
commit78f60ef1ef5a8f4af3317383985955da4f1d4fdb
authorrlp <rlp@chromium.org>
Thu, 23 Oct 2014 23:00:31 +0000 (23 16:00 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 23 Oct 2014 23:00:57 +0000 (23 23:00 +0000)
treec12d7ec1ecb94361d96947b0023df71335185959
parentc336bb11b60a4b5b2b087cad1ccc3d693886707c
[Hotword] Delay checking for audio devices until needed.

Checking for audio devices right away is causing performance regressions on Mac. This CL delays
checking until needed, but does not include the availability of an audio capture device in the
error reporting until after it's known the check has been completed. Otherwise, the settings
page immediately displays an error upon opening.

In general, this should not be a problem as typically the audio device check will have completed
by the time the user goes to the settings page. There is a rare use case, where the user
installs Chrome and immediately goes to settings and in that case, we won't be able to
accurately report if there is an audio device preventing the user from starting hotwording.
However, by the time they reload, the error should be present which should be sufficient.

BUG=385514,413104

Review URL: https://codereview.chromium.org/654613004

Cr-Commit-Position: refs/heads/master@{#300965}
chrome/browser/search/hotword_service.cc
chrome/browser/search/hotword_service.h
chrome/browser/search/hotword_service_factory.cc
chrome/browser/search/hotword_service_factory.h