Chromium Code Reviews| 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); |
| +} |