summaryrefslogtreecommitdiffstats
path: root/chrome/browser/speech/speech_input_manager.cc
diff options
context:
space:
mode:
authorsatish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-28 08:47:09 +0000
committersatish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-28 08:47:09 +0000
commitbefab4b7c401a2368fe313db1be59c83626c6b36 (patch)
tree07abbabbe42a391265c21d0f843c86d122abec96 /chrome/browser/speech/speech_input_manager.cc
parent2ae27702b4bd9bf31a19024131ba701c9253297c (diff)
downloadchromium_src-befab4b7c401a2368fe313db1be59c83626c6b36.zip
chromium_src-befab4b7c401a2368fe313db1be59c83626c6b36.tar.gz
chromium_src-befab4b7c401a2368fe313db1be59c83626c6b36.tar.bz2
Added grammar attribute to speech input.
In https://bugs.webkit.org/show_bug.cgi?id=48339 we added support for a 'x-webkit-grammar' attribute for speech input. In this CL we receive that as a parameter to SpeechInputDispatcher::startRecognition() and pass it up to the SpeechRecognitionRequest object which encodes and sends it as a url parameter to the server. To aid in this I also moved the speech server URL from SpeechRecognizer.cc to SpeechRecognitionRequest.cc. Also added a browser test for this attribute. It is marked as FLAKY now because the code is exactly the same as with the TestBasicRecognition test in that file and that test is FLAKY now. Both are marked with the same bug and I will remove the FLAKY_ prefix on both when the bug is closed. BUG=none TEST=browser_tests --gtest_filter=SpeechInputBrowserTest.GrammarAttribute Review URL: http://codereview.chromium.org/4183002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64213 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/speech/speech_input_manager.cc')
-rw-r--r--chrome/browser/speech/speech_input_manager.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/chrome/browser/speech/speech_input_manager.cc b/chrome/browser/speech/speech_input_manager.cc
index 5447087..24f0f5d7 100644
--- a/chrome/browser/speech/speech_input_manager.cc
+++ b/chrome/browser/speech/speech_input_manager.cc
@@ -28,7 +28,8 @@ class SpeechInputManagerImpl : public SpeechInputManager,
int caller_id,
int render_process_id,
int render_view_id,
- const gfx::Rect& element_rect);
+ const gfx::Rect& element_rect,
+ const std::string& grammar);
virtual void CancelRecognition(int caller_id);
virtual void StopRecording(int caller_id);
@@ -104,7 +105,8 @@ void SpeechInputManagerImpl::StartRecognition(
int caller_id,
int render_process_id,
int render_view_id,
- const gfx::Rect& element_rect) {
+ const gfx::Rect& element_rect,
+ const std::string& grammar) {
DCHECK(!HasPendingRequest(caller_id));
bubble_controller_->CreateBubble(caller_id, render_process_id, render_view_id,
@@ -112,7 +114,7 @@ void SpeechInputManagerImpl::StartRecognition(
SpeechInputRequest* request = &requests_[caller_id];
request->delegate = delegate;
- request->recognizer = new SpeechRecognizer(this, caller_id);
+ request->recognizer = new SpeechRecognizer(this, caller_id, grammar);
request->is_active = false;
StartRecognitionForRequest(caller_id);