| 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 <string> |
| 10 |
| 10 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
| 11 #include "ui/gfx/rect.h" | 12 #include "ui/gfx/rect.h" |
| 12 | 13 |
| 13 namespace content { | 14 namespace content { |
| 14 | 15 |
| 15 // The context information required by clients of the SpeechRecognitionManager | 16 // The context information required by clients of the SpeechRecognitionManager |
| 16 // and its delegates for mapping the recognition session to other browser | 17 // and its delegates for mapping the recognition session to other browser |
| 17 // elements involved with it (e.g., the page element that requested the | 18 // elements involved with it (e.g., the page element that requested the |
| 18 // recognition). The manager keeps this struct attached to the recognition | 19 // recognition). The manager keeps this struct attached to the recognition |
| 19 // session during all the session lifetime, making its contents available to | 20 // session during all the session lifetime, making its contents available to |
| 20 // clients (In this regard, see SpeechRecognitionManager::GetSessionContext and | 21 // clients (In this regard, see SpeechRecognitionManager::GetSessionContext and |
| 21 // SpeechRecognitionManager::LookupSessionByContext methods). | 22 // SpeechRecognitionManager::LookupSessionByContext methods). |
| 22 struct CONTENT_EXPORT SpeechRecognitionSessionContext { | 23 struct CONTENT_EXPORT SpeechRecognitionSessionContext { |
| 23 SpeechRecognitionSessionContext(); | 24 SpeechRecognitionSessionContext(); |
| 24 ~SpeechRecognitionSessionContext(); | 25 ~SpeechRecognitionSessionContext(); |
| 25 | 26 |
| 26 int render_process_id; | 27 int render_process_id; |
| 27 int render_view_id; | 28 int render_view_id; |
| 28 int request_id; | 29 int request_id; |
| 29 | 30 |
| 30 // Determines whether recognition was requested by a page element (in which | 31 // Determines whether recognition was requested by a page element (in which |
| 31 // case its coordinates are passed in |element_rect|). | 32 // case its coordinates are passed in |element_rect|). |
| 32 bool requested_by_page_element; | 33 bool requested_by_page_element; |
| 33 | 34 |
| 34 // The coordinates of the page element for placing the bubble (valid only when | 35 // The coordinates of the page element for placing the bubble (valid only when |
| 35 // |requested_by_page_element| = true). | 36 // |requested_by_page_element| = true). |
| 36 gfx::Rect element_rect; | 37 gfx::Rect element_rect; |
| 37 | 38 |
| 38 // Determines whether this is the first time that this context (identified by | |
| 39 // |context_name|) is requesting a recognition. | |
| 40 // TODO(primiano) This is really temporary, remove after CL1.12 which will | |
| 41 // refactor SpeechRecognitionPreferences and move this check entirely whithin | |
| 42 // chrome, without involving content. | |
| 43 bool is_first_request_for_context; | |
| 44 | |
| 45 // A texual description of the context (website, extension name) that is | 39 // A texual description of the context (website, extension name) that is |
| 46 // requesting recognition, for prompting security notifications to the user. | 40 // requesting recognition, for prompting security notifications to the user. |
| 47 string16 context_name; | 41 std::string context_name; |
| 48 }; | 42 }; |
| 49 | 43 |
| 50 } // namespace content | 44 } // namespace content |
| 51 | 45 |
| 52 #endif // CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNITION_SESSION_CONTEXT_H_ | 46 #endif // CONTENT_PUBLIC_BROWSER_SPEECH_RECOGNITION_SESSION_CONTEXT_H_ |
| OLD | NEW |