Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1521)

Unified Diff: content/browser/renderer_host/render_view_host.cc

Issue 7086005: Context menu for "Voice recognition options" (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Context menu for "Voice recognition options" only appears when input-field has x-webkit-speech Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_view_host.cc
diff --git a/content/browser/renderer_host/render_view_host.cc b/content/browser/renderer_host/render_view_host.cc
index 2376d887da51e22987dc3f71df514e1fe0a1a0a8..bcd60fc2715930397826a2ceff94a6c7c56cce62 100644
--- a/content/browser/renderer_host/render_view_host.cc
+++ b/content/browser/renderer_host/render_view_host.cc
@@ -15,6 +15,7 @@
#include "base/time.h"
#include "base/utf_string_conversions.h"
#include "base/values.h"
+#include "chrome/browser/google/google_util.h"
#include "chrome/browser/profiles/profile.h"
#include "content/browser/browser_message_filter.h"
#include "content/browser/child_process_security_policy.h"
@@ -63,6 +64,14 @@ namespace {
// Delay to wait on closing the tab for a beforeunload/unload handler to fire.
const int kUnloadTimeoutMS = 1000;
+// The URL to be opened when the "About Voice Recognition" menu item is clicked.
+// TODO(gshires): Replace with actual URL when proper help page is posted.
+const char kSpeechInputAboutUrl[] =
+#if defined(OS_CHROMEOS)
Satish 2011/07/19 08:22:39 any reason why we need two different urls here? If
gshires 2011/07/19 22:56:31 No need to differentiate. I made this consistent w
+ "https://www.google.com/support/chromeos/";
+#else
+ "https://www.google.com/support/chrome/";
+#endif
} // namespace
///////////////////////////////////////////////////////////////////////////////
@@ -511,6 +520,13 @@ void RenderViewHost::SelectAll() {
UserMetrics::RecordAction(UserMetricsAction("SelectAll"));
}
+void RenderViewHost::SpeechInputAbout() {
+ GURL about_url(kSpeechInputAboutUrl);
+ GURL localized_about_url = google_util::AppendGoogleLocaleParam(about_url);
+ // Open URL with no referrer field (because user clicked on menu item).
+ delegate_->RequestOpenURL(localized_about_url, GURL(), NEW_FOREGROUND_TAB);
+}
+
void RenderViewHost::JavaScriptDialogClosed(IPC::Message* reply_msg,
bool success,
const string16& user_input) {

Powered by Google App Engine
This is Rietveld 408576698