diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-07 13:12:53 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-07 13:12:53 +0000 |
commit | 2b94cfe5dd1f0797adc9ceb1f972a7121057901c (patch) | |
tree | 81adb9be920dbae538c9b8c6ed9366a166d12aac /content/browser/speech/speech_recognition_manager_impl.h | |
parent | 0f531d70380d25e306f99674cb8ba8aa8dbbebd2 (diff) | |
download | chromium_src-2b94cfe5dd1f0797adc9ceb1f972a7121057901c.zip chromium_src-2b94cfe5dd1f0797adc9ceb1f972a7121057901c.tar.gz chromium_src-2b94cfe5dd1f0797adc9ceb1f972a7121057901c.tar.bz2 |
Replace MediaStreamUIController with MediaStreamUIProxy.
Previously a single object MediaStreamUIController was used to control UI for
all streams. Replaced it with a per-stream MediaStreamUIProxy that simplifies
code in many places.
Also moved media request queueing logic from content layer to chrome. Now
different types of requests may be queued differently (e.g. there is no
reason to block screen capture requests on webcam infobar).
This change was previously landed in 197222 and reverted in 197242
TBR=tommi@chromium.org
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=204044
Review URL: https://chromiumcodereview.appspot.com/16342002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204808 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/speech/speech_recognition_manager_impl.h')
-rw-r--r-- | content/browser/speech/speech_recognition_manager_impl.h | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/content/browser/speech/speech_recognition_manager_impl.h b/content/browser/speech/speech_recognition_manager_impl.h index e9ea5a0..d7cc3c1 100644 --- a/content/browser/speech/speech_recognition_manager_impl.h +++ b/content/browser/speech/speech_recognition_manager_impl.h @@ -21,6 +21,7 @@ namespace content { class BrowserMainLoop; +class MediaStreamUIProxy; class SpeechRecognitionManagerDelegate; class SpeechRecognizer; @@ -122,6 +123,7 @@ class CONTENT_EXPORT SpeechRecognitionManagerImpl : SpeechRecognitionSessionConfig config; SpeechRecognitionSessionContext context; scoped_refptr<SpeechRecognizer> recognizer; + scoped_ptr<MediaStreamUIProxy> ui; }; // Callback issued by the SpeechRecognitionManagerDelegate for reporting @@ -130,19 +132,21 @@ class CONTENT_EXPORT SpeechRecognitionManagerImpl : bool ask_user, bool is_allowed); - // Callback to get back the result of a media request. |label| is the string - // to identify the request; |devices| is an array of devices approved to be - // used for the request, |devices| is empty if the users deny the request. - void MediaRequestPermissionCallback(const std::string& label, - const MediaStreamDevices& devices); + // Callback to get back the result of a media request. |devices| is an array + // of devices approved to be used for the request, |devices| is empty if the + // users deny the request. + void MediaRequestPermissionCallback(int session_id, + const MediaStreamDevices& devices, + scoped_ptr<MediaStreamUIProxy> stream_ui); // Entry point for pushing any external event into the session handling FSM. void DispatchEvent(int session_id, FSMEvent event); // Defines the behavior of the session handling FSM, selecting the appropriate // transition according to the session, its current state and the event. - void ExecuteTransitionAndGetNextState( - const Session& session, FSMState session_state, FSMEvent event); + void ExecuteTransitionAndGetNextState(Session* session, + FSMState session_state, + FSMEvent event); // Retrieves the state of the session, enquiring directly the recognizer. FSMState GetSessionState(int session_id) const; @@ -152,16 +156,16 @@ class CONTENT_EXPORT SpeechRecognitionManagerImpl : void SessionAbort(const Session& session); void SessionStopAudioCapture(const Session& session); void ResetCapturingSessionId(const Session& session); - void SessionDelete(const Session& session); + void SessionDelete(Session* session); void NotFeasible(const Session& session, FSMEvent event); bool SessionExists(int session_id) const; - const Session& GetSession(int session_id) const; + Session* GetSession(int session_id) const; SpeechRecognitionEventListener* GetListener(int session_id) const; SpeechRecognitionEventListener* GetDelegateListener() const; int GetNextSessionID(); - typedef std::map<int, Session> SessionsTable; + typedef std::map<int, Session*> SessionsTable; SessionsTable sessions_; int primary_session_id_; int last_session_id_; |