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

Unified Diff: chrome/browser/ui/search/search_ipc_router.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
Index: chrome/browser/ui/search/search_ipc_router.cc
diff --git a/chrome/browser/ui/search/search_ipc_router.cc b/chrome/browser/ui/search/search_ipc_router.cc
index 18de36433ac9b8ebd33a1c4cf12ea955f2e99aca..72598b24e363ebc75b62b4870f63050fb80fafbb 100644
--- a/chrome/browser/ui/search/search_ipc_router.cc
+++ b/chrome/browser/ui/search/search_ipc_router.cc
@@ -137,6 +137,13 @@
Send(new ChromeViewMsg_SearchBoxThemeChanged(routing_id(), theme_info));
}
+void SearchIPCRouter::ToggleVoiceSearch() {
+ if (!policy_->ShouldSendToggleVoiceSearch())
+ return;
+
+ Send(new ChromeViewMsg_SearchBoxToggleVoiceSearch(routing_id()));
+}
+
void SearchIPCRouter::Submit(const base::string16& text,
const EmbeddedSearchRequestParams& params) {
if (!policy_->ShouldSubmitQuery())
@@ -166,6 +173,8 @@
IPC_BEGIN_MESSAGE_MAP(SearchIPCRouter, message)
IPC_MESSAGE_HANDLER(ChromeViewHostMsg_InstantSupportDetermined,
OnInstantSupportDetermined)
+ IPC_MESSAGE_HANDLER(ChromeViewHostMsg_SetVoiceSearchSupported,
+ OnVoiceSearchSupportDetermined)
IPC_MESSAGE_HANDLER(ChromeViewHostMsg_FocusOmnibox, OnFocusOmnibox);
IPC_MESSAGE_HANDLER(ChromeViewHostMsg_SearchBoxNavigate,
OnSearchBoxNavigate);
@@ -199,6 +208,19 @@
delegate_->OnInstantSupportDetermined(instant_support);
}
+void SearchIPCRouter::OnVoiceSearchSupportDetermined(
+ int page_seq_no,
+ bool supports_voice_search) const {
+ if (page_seq_no != commit_counter_)
+ return;
+
+ delegate_->OnInstantSupportDetermined(true);
+ if (!policy_->ShouldProcessSetVoiceSearchSupport())
+ return;
+
+ delegate_->OnSetVoiceSearchSupport(supports_voice_search);
+}
+
void SearchIPCRouter::OnFocusOmnibox(int page_seq_no,
OmniboxFocusState state) const {
if (page_seq_no != commit_counter_)
« no previous file with comments | « chrome/browser/ui/search/search_ipc_router.h ('k') | chrome/browser/ui/search/search_ipc_router_policy_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698