Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Side by Side Diff: content/public/browser/speech_recognition_manager.h

Issue 636863003: Make SpeechRecognition per RenderFrame instead of per RenderView. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes threading issues Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNITION_MANAGER_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNITION_MANAGER_H_
6 #define CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNITION_MANAGER_H_ 6 #define CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNITION_MANAGER_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/strings/string16.h" 9 #include "base/strings/string16.h"
10 #include "content/common/content_export.h" 10 #include "content/common/content_export.h"
(...skipping 30 matching lines...) Expand all
41 // Creates a new recognition session. 41 // Creates a new recognition session.
42 virtual int CreateSession(const SpeechRecognitionSessionConfig& config) = 0; 42 virtual int CreateSession(const SpeechRecognitionSessionConfig& config) = 0;
43 43
44 // Starts/restarts recognition for an existing session, after performing a 44 // Starts/restarts recognition for an existing session, after performing a
45 // premilinary check on the delegate (CheckRecognitionIsAllowed). 45 // premilinary check on the delegate (CheckRecognitionIsAllowed).
46 virtual void StartSession(int session_id) = 0; 46 virtual void StartSession(int session_id) = 0;
47 47
48 // Aborts recognition for an existing session, without providing any result. 48 // Aborts recognition for an existing session, without providing any result.
49 virtual void AbortSession(int session_id) = 0; 49 virtual void AbortSession(int session_id) = 0;
50 50
51 // Aborts all sessions for a given render process, 51 // Aborts all sessions for a given RenderFrame, without providing any result.
52 // without providing any result. 52 virtual void AbortAllSessionsForRenderFrame(int render_process_id,
53 virtual void AbortAllSessionsForRenderProcess(int render_process_id) = 0; 53 int render_frame_id) = 0;
54
55 // Aborts all sessions for a given RenderView, without providing any result.
56 virtual void AbortAllSessionsForRenderView(int render_process_id,
57 int render_view_id) = 0;
58 54
59 // Stops audio capture for an existing session. The audio captured before the 55 // Stops audio capture for an existing session. The audio captured before the
60 // call will be processed, possibly ending up with a result. 56 // call will be processed, possibly ending up with a result.
61 virtual void StopAudioCaptureForSession(int session_id) = 0; 57 virtual void StopAudioCaptureForSession(int session_id) = 0;
62 58
63 // Retrieves the configuration of a session, as provided by the caller 59 // Retrieves the configuration of a session, as provided by the caller
64 // upon CreateSession. 60 // upon CreateSession.
65 virtual const SpeechRecognitionSessionConfig& GetSessionConfig(int session_id) 61 virtual const SpeechRecognitionSessionConfig& GetSessionConfig(int session_id)
66 const = 0; 62 const = 0;
67 63
68 // Retrieves the context associated to a session. 64 // Retrieves the context associated to a session.
69 virtual SpeechRecognitionSessionContext GetSessionContext( 65 virtual SpeechRecognitionSessionContext GetSessionContext(
70 int session_id) const = 0; 66 int session_id) const = 0;
71 67
72 // Looks-up an existing session from the context tuple 68 // Looks-up an existing session from the context tuple
73 // {render_view_id, render_view_id, request_id}. 69 // {render_process_id, render_frame_id, request_id}.
74 virtual int GetSession(int render_process_id, 70 virtual int GetSession(int render_process_id,
75 int render_view_id, 71 int render_frame_id,
76 int request_id) const = 0; 72 int request_id) const = 0;
77 73
78 // Returns true if the OS reports existence of audio recording devices. 74 // Returns true if the OS reports existence of audio recording devices.
79 virtual bool HasAudioInputDevices() = 0; 75 virtual bool HasAudioInputDevices() = 0;
80 76
81 // Returns a human readable string for the model/make of the active audio 77 // Returns a human readable string for the model/make of the active audio
82 // input device for this computer. 78 // input device for this computer.
83 virtual base::string16 GetAudioInputDeviceModel() = 0; 79 virtual base::string16 GetAudioInputDeviceModel() = 0;
84 80
85 // Invokes the platform provided microphone settings UI in a non-blocking way, 81 // Invokes the platform provided microphone settings UI in a non-blocking way,
86 // via the BrowserThread::FILE thread. 82 // via the BrowserThread::FILE thread.
87 virtual void ShowAudioInputSettings() = 0; 83 virtual void ShowAudioInputSettings() = 0;
88 84
89 protected: 85 protected:
90 virtual ~SpeechRecognitionManager() {} 86 virtual ~SpeechRecognitionManager() {}
91 87
92 private: 88 private:
93 static SpeechRecognitionManager* manager_for_tests_; 89 static SpeechRecognitionManager* manager_for_tests_;
94 }; 90 };
95 91
96 } // namespace content 92 } // namespace content
97 93
98 #endif // CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNITION_MANAGER_H_ 94 #endif // CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNITION_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698