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

Unified Diff: chrome/renderer/searchbox/searchbox.cc

Issue 1436583002: Revert of Remove setVoiceSearchSupported part of EmbeddedSearch SearchBox API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « chrome/renderer/searchbox/searchbox.h ('k') | chrome/renderer/searchbox/searchbox_extension.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/searchbox/searchbox.cc
diff --git a/chrome/renderer/searchbox/searchbox.cc b/chrome/renderer/searchbox/searchbox.cc
index d231c81b245cc837013e0ca57ee98a935d2886a4..8d84d8ccfa723934f1a33ef1244c0796cf933644 100644
--- a/chrome/renderer/searchbox/searchbox.cc
+++ b/chrome/renderer/searchbox/searchbox.cc
@@ -336,6 +336,11 @@
void SearchBox::Paste(const base::string16& text) {
render_view()->Send(new ChromeViewHostMsg_PasteAndOpenDropdown(
render_view()->GetRoutingID(), page_seq_no_, text));
+}
+
+void SearchBox::SetVoiceSearchSupported(bool supported) {
+ render_view()->Send(new ChromeViewHostMsg_SetVoiceSearchSupported(
+ render_view()->GetRoutingID(), page_seq_no_, supported));
}
void SearchBox::StartCapturingKeyStrokes() {
@@ -387,6 +392,8 @@
IPC_MESSAGE_HANDLER(ChromeViewMsg_SearchBoxSubmit, OnSubmit)
IPC_MESSAGE_HANDLER(ChromeViewMsg_SearchBoxThemeChanged,
OnThemeChanged)
+ IPC_MESSAGE_HANDLER(ChromeViewMsg_SearchBoxToggleVoiceSearch,
+ OnToggleVoiceSearch)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
@@ -536,6 +543,13 @@
}
}
+void SearchBox::OnToggleVoiceSearch() {
+ if (render_view()->GetWebView() && render_view()->GetWebView()->mainFrame()) {
+ extensions_v8::SearchBoxExtension::DispatchToggleVoiceSearch(
+ render_view()->GetWebView()->mainFrame());
+ }
+}
+
GURL SearchBox::GetURLForMostVisitedItem(InstantRestrictedID item_id) const {
InstantMostVisitedItem item;
return GetMostVisitedItemWithID(item_id, &item) ? item.url : GURL();
« no previous file with comments | « chrome/renderer/searchbox/searchbox.h ('k') | chrome/renderer/searchbox/searchbox_extension.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698