OLD | NEW |
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_SESSION_CONTEXT_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNITION_SESSION_CONTEXT_H_ |
6 #define CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNITION_SESSION_CONTEXT_H_ | 6 #define CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNITION_SESSION_CONTEXT_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
| 9 #include "base/string16.h" |
9 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
10 #include "ui/gfx/rect.h" | 11 #include "ui/gfx/rect.h" |
11 | 12 |
12 namespace content { | 13 namespace content { |
13 | 14 |
14 // The context information required by clients of the SpeechRecognitionManager | 15 // The context information required by clients of the SpeechRecognitionManager |
15 // (InputTagSpeechDispatcherHost) and its delegates for mapping the recognition | 16 // and its delegates for mapping the recognition session to other browser |
16 // session to other browser elements involved with the it (e.g., the page | 17 // elements involved with the it (e.g., the page element that requested the |
17 // element that requested the recognition). The SpeechRecognitionManager is | 18 // recognition). The SpeechRecognitionManager is not aware of the content of |
18 // not aware of the content of this struct and does NOT use it for its purposes. | 19 // this struct and does NOT use it for its purposes. However the manager keeps |
19 // However the manager keeps this struct "attached" to the recognition session | 20 // this struct "attached" to the recognition session during all the session |
20 // during all the session lifetime, making its contents available to clients | 21 // lifetime, making its contents available to clients (In this regard, see |
21 // (In this regard, see SpeechRecognitionManager::GetSessionContext and | 22 // SpeechRecognitionManager::GetSessionContext and |
22 // SpeechRecognitionManager::LookupSessionByContext methods). | 23 // SpeechRecognitionManager::LookupSessionByContext methods). |
23 struct CONTENT_EXPORT SpeechRecognitionSessionContext { | 24 struct CONTENT_EXPORT SpeechRecognitionSessionContext { |
24 SpeechRecognitionSessionContext() | 25 SpeechRecognitionSessionContext(); |
25 : render_process_id(0), | 26 ~SpeechRecognitionSessionContext(); |
26 render_view_id(0), | |
27 render_request_id(0) {} | |
28 ~SpeechRecognitionSessionContext() {} | |
29 | 27 |
30 int render_process_id; | 28 int render_process_id; |
31 int render_view_id; | 29 int render_view_id; |
32 int render_request_id; | 30 int render_request_id; |
| 31 |
| 32 // Determines whether recognition shall use an active bubble on a page element |
| 33 // (which coordinates are passed in |element_rect|) or a background tray icon. |
| 34 bool use_bubble_on_element; |
| 35 |
| 36 // The coordinates of the page element for placing the bubble (valid only when |
| 37 // |use_bubble_on_element| = true). |
33 gfx::Rect element_rect; | 38 gfx::Rect element_rect; |
| 39 |
| 40 // Determines whether a security notification balloon shall pop-up together |
| 41 // with the tray icon (valid only when |use_bubble_on_element| = false). |
| 42 bool show_security_balloon; |
| 43 |
| 44 // A texual description of the context (website, extension name) that is |
| 45 // requesting recognition, for prompting security notifications to the user. |
| 46 string16 context_name; |
34 }; | 47 }; |
35 | 48 |
36 } // namespace content | 49 } // namespace content |
37 | 50 |
38 #endif // CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNITION_SESSION_CONTEXT_H_ | 51 #endif // CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNITION_SESSION_CONTEXT_H_ |
OLD | NEW |