summaryrefslogtreecommitdiffstats
path: root/chrome/browser/speech
diff options
context:
space:
mode:
authorsatish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-23 17:58:08 +0000
committersatish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-23 17:58:08 +0000
commitb4329dc5eb2479619709d35c4bec1ca7a6659507 (patch)
treedb8153bd676802a8224e44c7b1c379181efbd687 /chrome/browser/speech
parent0b5cabf89066b80446138ecfe288af25a5f4e3f9 (diff)
downloadchromium_src-b4329dc5eb2479619709d35c4bec1ca7a6659507.zip
chromium_src-b4329dc5eb2479619709d35c4bec1ca7a6659507.tar.gz
chromium_src-b4329dc5eb2479619709d35c4bec1ca7a6659507.tar.bz2
When waiting for server, show a 'Working' message instead of 'Speak now'.
Also request the server to return a max of 3 results in the response. This is in preparation to test multiple recognition results in a future CL. BUG=none TEST=no change in functionality. Review URL: http://codereview.chromium.org/5281003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67115 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/speech')
-rw-r--r--chrome/browser/speech/speech_input_bubble_gtk.cc7
-rw-r--r--chrome/browser/speech/speech_input_bubble_views.cc3
-rw-r--r--chrome/browser/speech/speech_recognition_request.cc3
3 files changed, 11 insertions, 2 deletions
diff --git a/chrome/browser/speech/speech_input_bubble_gtk.cc b/chrome/browser/speech/speech_input_bubble_gtk.cc
index 923f327..2b159bf 100644
--- a/chrome/browser/speech/speech_input_bubble_gtk.cc
+++ b/chrome/browser/speech/speech_input_bubble_gtk.cc
@@ -179,14 +179,17 @@ void SpeechInputBubbleGtk::UpdateLayout() {
} else {
// Heading text, icon and cancel button are visible, hide the Try Again
// button.
- gtk_label_set_text(GTK_LABEL(label_),
- l10n_util::GetStringUTF8(IDS_SPEECH_INPUT_BUBBLE_HEADING).c_str());
if (display_mode() == DISPLAY_MODE_RECORDING) {
+ gtk_label_set_text(GTK_LABEL(label_),
+ l10n_util::GetStringUTF8(IDS_SPEECH_INPUT_BUBBLE_HEADING).c_str());
SkBitmap* image = ResourceBundle::GetSharedInstance().GetBitmapNamed(
IDR_SPEECH_INPUT_MIC_EMPTY);
GdkPixbuf* pixbuf = gfx::GdkPixbufFromSkBitmap(image);
gtk_image_set_from_pixbuf(GTK_IMAGE(icon_), pixbuf);
g_object_unref(pixbuf);
+ } else {
+ gtk_label_set_text(GTK_LABEL(label_),
+ l10n_util::GetStringUTF8(IDS_SPEECH_INPUT_BUBBLE_WORKING).c_str());
}
gtk_widget_show(icon_);
gtk_widget_hide(try_again_button_);
diff --git a/chrome/browser/speech/speech_input_bubble_views.cc b/chrome/browser/speech/speech_input_bubble_views.cc
index 7f2d52a..2dd624f 100644
--- a/chrome/browser/speech/speech_input_bubble_views.cc
+++ b/chrome/browser/speech/speech_input_bubble_views.cc
@@ -103,8 +103,11 @@ void ContentView::UpdateLayout(SpeechInputBubbleBase::DisplayMode mode,
if (mode == SpeechInputBubbleBase::DISPLAY_MODE_MESSAGE) {
message_->SetText(UTF16ToWideHack(message_text));
} else if (mode == SpeechInputBubbleBase::DISPLAY_MODE_RECORDING) {
+ heading_->SetText(l10n_util::GetString(IDS_SPEECH_INPUT_BUBBLE_HEADING));
icon_->SetImage(*ResourceBundle::GetSharedInstance().GetBitmapNamed(
IDR_SPEECH_INPUT_MIC_EMPTY));
+ } else {
+ heading_->SetText(l10n_util::GetString(IDS_SPEECH_INPUT_BUBBLE_WORKING));
}
}
diff --git a/chrome/browser/speech/speech_recognition_request.cc b/chrome/browser/speech/speech_recognition_request.cc
index 63a6c92..b1234b0 100644
--- a/chrome/browser/speech/speech_recognition_request.cc
+++ b/chrome/browser/speech/speech_recognition_request.cc
@@ -148,6 +148,9 @@ bool SpeechRecognitionRequest::Send(const std::string& language,
parts.push_back("lm=" + EscapeQueryParamValue(grammar, true));
if (!hardware_info.empty())
parts.push_back("xhw=" + EscapeQueryParamValue(hardware_info, true));
+ // TODO(satish): Remove this hardcoded value once the page is allowed to
+ // set this via an attribute.
+ parts.push_back("maxresults=3");
GURL url(std::string(kDefaultSpeechRecognitionUrl) + JoinString(parts, '&'));