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_DELEGATE_H_
6 #define CHROME_BROWSER_UI_APP_LIST_SPEECH_RECOGNIZER_DELEGATE_H_
11 #include "base/strings/string16.h"
12 #include "ui/app_list/speech_ui_model_observer.h"
20 // Delegate for the app list speech recognizer. All methods are called from the
22 class SpeechRecognizerDelegate
{
24 // Receive a speech recognition result. |is_final| indicated whether the
25 // result is an intermediate or final result. If |is_final| is true, then the
26 // recognizer stops and no more results will be returned.
27 virtual void OnSpeechResult(const base::string16
& query
, bool is_final
) = 0;
29 // Invoked regularly to indicate the average sound volume.
30 virtual void OnSpeechSoundLevelChanged(int16_t level
) = 0;
32 // Invoked when the state of speech recognition is changed.
33 virtual void OnSpeechRecognitionStateChanged(
34 SpeechRecognitionState new_state
) = 0;
36 // Get the OAuth2 scope and token to pass to the speech recognizer. Does not
37 // modify the arguments if no auth token is available or allowed.
38 virtual void GetSpeechAuthParameters(std::string
* auth_scope
,
39 std::string
* auth_token
) = 0;
42 virtual ~SpeechRecognizerDelegate() {}
45 } // namespace app_list
47 #endif // CHROME_BROWSER_UI_APP_LIST_SPEECH_RECOGNIZER_DELEGATE_H_