1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_APP_LIST_SPEECH_RECOGNIZER_H_
6 #define CHROME_BROWSER_UI_APP_LIST_SPEECH_RECOGNIZER_H_
10 #include "base/memory/weak_ptr.h"
13 struct SpeechRecognitionSessionPreamble
;
17 class URLRequestContextGetter
;
22 class SpeechRecognizerDelegate
;
24 // SpeechRecognizer is a wrapper around the speech recognition engine that
25 // simplifies its use from the UI thread. This class handles all setup/shutdown,
26 // collection of results, error cases, and threading.
27 class SpeechRecognizer
{
29 SpeechRecognizer(const base::WeakPtr
<SpeechRecognizerDelegate
>& delegate
,
30 net::URLRequestContextGetter
* url_request_context_getter
,
31 const std::string
& locale
);
34 // Start/stop the speech recognizer. |preamble| contains the preamble audio to
35 // log if auth parameters are available.
36 // Must be called on the UI thread.
38 const scoped_refptr
<content::SpeechRecognitionSessionPreamble
>& preamble
);
44 base::WeakPtr
<SpeechRecognizerDelegate
> delegate_
;
45 scoped_refptr
<EventListener
> speech_event_listener_
;
47 DISALLOW_COPY_AND_ASSIGN(SpeechRecognizer
);
50 } // namespace app_list
52 #endif // CHROME_BROWSER_UI_APP_LIST_SPEECH_RECOGNIZER_H_