1 // Copyright (c) 2012 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.
4 
5 #ifndef CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNITION_SESSION_CONFIG_H_
6 #define CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNITION_SESSION_CONFIG_H_
7 
8 #include <stdint.h>
9 
10 #include <string>
11 
12 #include "base/memory/ref_counted.h"
13 #include "base/memory/weak_ptr.h"
14 #include "content/common/content_export.h"
15 #include "content/public/browser/speech_recognition_session_context.h"
16 #include "content/public/browser/speech_recognition_session_preamble.h"
17 #include "services/network/public/cpp/shared_url_loader_factory.h"
18 #include "third_party/blink/public/mojom/speech/speech_recognition_grammar.mojom.h"
19 #include "url/origin.h"
20 
21 namespace content {
22 
23 class SpeechRecognitionEventListener;
24 
25 // Configuration params for creating a new speech recognition session.
26 struct CONTENT_EXPORT SpeechRecognitionSessionConfig {
27   SpeechRecognitionSessionConfig();
28   SpeechRecognitionSessionConfig(const SpeechRecognitionSessionConfig& other);
29   ~SpeechRecognitionSessionConfig();
30 
31   std::string language;
32   // Accept language header. If |language| is empty, used to get a language
33   // instead.
34   std::string accept_language;
35   std::vector<blink::mojom::SpeechRecognitionGrammar> grammars;
36   url::Origin origin;
37   bool filter_profanities;
38   bool continuous;
39   bool interim_results;
40   uint32_t max_hypotheses;
41   std::string auth_token;
42   std::string auth_scope;
43   scoped_refptr<SpeechRecognitionSessionPreamble> preamble;
44   SpeechRecognitionSessionContext initial_context;
45   scoped_refptr<network::SharedURLLoaderFactory> shared_url_loader_factory;
46 
47   base::WeakPtr<SpeechRecognitionEventListener> event_listener;
48 };
49 
50 }  // namespace content
51 
52 #endif  // CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNITION_SESSION_CONFIG_H_
53