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.
5 #ifndef CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNITION_SESSION_CONTEXT_H_
6 #define CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNITION_SESSION_CONTEXT_H_
10 #include "content/common/content_export.h"
11 #include "content/public/common/media_stream_request.h"
12 #include "ui/gfx/rect.h"
16 // The context information required by clients of the SpeechRecognitionManager
17 // and its delegates for mapping the recognition session to other browser
18 // elements involved with it (e.g., the page element that requested the
19 // recognition). The manager keeps this struct attached to the recognition
20 // session during all the session lifetime, making its contents available to
21 // clients (In this regard, see SpeechRecognitionManager::GetSessionContext and
22 // SpeechRecognitionManager::LookupSessionByContext methods).
23 struct CONTENT_EXPORT SpeechRecognitionSessionContext
{
24 SpeechRecognitionSessionContext();
25 ~SpeechRecognitionSessionContext();
27 int render_process_id
;
30 // Browser plugin guest's render view id, if this context represents a speech
31 // recognition request from an embedder on behalf of the guest. This is used
32 // for input tag where speech bubble is to be shown.
34 // TODO(lazyboy): Right now showing bubble from guest does not work, we fall
35 // back to embedder instead, fix this and use
36 // embedder_render_process_id/embedder_render_view_id similar to Web Speech
38 int guest_render_view_id
;
40 // The pair (|embedder_render_process_id|, |embedder_render_view_id|)
41 // represents a Browser plugin guest's embedder. This is filled in if the
42 // session is from a guest Web Speech API. We use these to check if the
43 // embedder (app) is permitted to use audio.
44 int embedder_render_process_id
;
45 int embedder_render_view_id
;
49 // A texual description of the context (website, extension name) that is
50 // requesting recognition, for prompting security notifications to the user.
51 std::string context_name
;
53 // The label for the permission request, it is used for request abortion.
56 // A list of devices being used by the recognition session.
57 MediaStreamDevices devices
;
60 } // namespace content
62 #endif // CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNITION_SESSION_CONTEXT_H_