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

Unified Diff: chrome/browser/ui/search/search_tab_helper.cc

Issue 17132011: Add setVoiceSearchSupported to the searchbox API. This will be used to determine whether to show a … (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Respond and revert changes. Created 7 years, 6 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
« no previous file with comments | « chrome/browser/ui/search/search_tab_helper.h ('k') | chrome/common/render_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/search/search_tab_helper.cc
diff --git a/chrome/browser/ui/search/search_tab_helper.cc b/chrome/browser/ui/search/search_tab_helper.cc
index 4cbbd8aa2dfe33e1049e180d742d98c106842fdc..384565034e62c9b1a37200ebcb0902e4f8ea357f 100644
--- a/chrome/browser/ui/search/search_tab_helper.cc
+++ b/chrome/browser/ui/search/search_tab_helper.cc
@@ -91,6 +91,7 @@ void SearchTabHelper::Observe(
DCHECK_EQ(content::NOTIFICATION_NAV_ENTRY_COMMITTED, type);
UpdateMode();
last_known_most_visited_items_.clear();
+ model_.SetVoiceSearchSupported(false);
samarth 2013/06/19 22:55:16 Sorry, this is a bit more subtle. You should do th
jeremycho 2013/06/20 19:35:52 Done.
}
bool SearchTabHelper::OnMessageReceived(const IPC::Message& message) {
@@ -100,6 +101,8 @@ bool SearchTabHelper::OnMessageReceived(const IPC::Message& message) {
OnSearchBoxShowBars)
IPC_MESSAGE_HANDLER(ChromeViewHostMsg_SearchBoxHideBars,
OnSearchBoxHideBars)
+ IPC_MESSAGE_HANDLER(ChromeViewHostMsg_SetVoiceSearchSupported,
+ OnSetVoiceSearchSupported)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
@@ -122,12 +125,13 @@ void SearchTabHelper::UpdateMode() {
!popup_is_open_ && !user_text_is_empty_) {
// We're switching back (|popup_is_open_| is false) to an NTP (type and
// mode are |NTP|) with suggestions (|user_text_is_empty_| is false), don't
- // modify visibility of top bars. This specific omnibox state is set when
- // OmniboxEditModelChanged() is called from
+ // modify visibility of top bars or voice search support. This specific
+ // omnibox state is set when OmniboxEditModelChanged() is called from
// OmniboxEditModel::SetInputInProgress() which is called from
// OmniboxEditModel::Revert().
model_.SetState(SearchModel::State(SearchMode(type, origin),
- model_.state().top_bars_visible));
+ model_.state().top_bars_visible,
+ model_.state().voice_search_supported));
} else {
model_.SetMode(SearchMode(type, origin));
}
@@ -144,3 +148,8 @@ void SearchTabHelper::OnSearchBoxHideBars(int page_id) {
Send(new ChromeViewMsg_SearchBoxBarsHidden(routing_id()));
}
}
+
+void SearchTabHelper::OnSetVoiceSearchSupported(int page_id, bool supported) {
+ if (web_contents()->IsActiveEntry(page_id))
+ model_.SetVoiceSearchSupported(supported);
+}
« no previous file with comments | « chrome/browser/ui/search/search_tab_helper.h ('k') | chrome/common/render_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698