| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/search/search_tab_helper.h" | 5 #include "chrome/browser/ui/search/search_tab_helper.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 entry); | 352 entry); |
| 353 if (delegate_ && model_.instant_support() == INSTANT_SUPPORT_NO) | 353 if (delegate_ && model_.instant_support() == INSTANT_SUPPORT_NO) |
| 354 delegate_->OnWebContentsInstantSupportDisabled(web_contents_); | 354 delegate_->OnWebContentsInstantSupportDisabled(web_contents_); |
| 355 return; | 355 return; |
| 356 } | 356 } |
| 357 | 357 |
| 358 model_.SetInstantSupportState(INSTANT_SUPPORT_UNKNOWN); | 358 model_.SetInstantSupportState(INSTANT_SUPPORT_UNKNOWN); |
| 359 model_.SetVoiceSearchSupported(false); | 359 model_.SetVoiceSearchSupported(false); |
| 360 chrome::SetInstantSupportStateInNavigationEntry(model_.instant_support(), | 360 chrome::SetInstantSupportStateInNavigationEntry(model_.instant_support(), |
| 361 entry); | 361 entry); |
| 362 |
| 363 if (InInstantProcess(profile(), web_contents_)) |
| 364 ipc_router_.OnNavigationEntryCommitted(); |
| 362 } | 365 } |
| 363 | 366 |
| 364 void SearchTabHelper::OnInstantSupportDetermined(bool supports_instant) { | 367 void SearchTabHelper::OnInstantSupportDetermined(bool supports_instant) { |
| 365 InstantSupportChanged(supports_instant); | 368 InstantSupportChanged(supports_instant); |
| 366 } | 369 } |
| 367 | 370 |
| 368 void SearchTabHelper::OnSetVoiceSearchSupport(bool supports_voice_search) { | 371 void SearchTabHelper::OnSetVoiceSearchSupport(bool supports_voice_search) { |
| 369 model_.SetVoiceSearchSupported(supports_voice_search); | 372 model_.SetVoiceSearchSupported(supports_voice_search); |
| 370 } | 373 } |
| 371 | 374 |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 | 587 |
| 585 bool SearchTabHelper::IsInputInProgress() const { | 588 bool SearchTabHelper::IsInputInProgress() const { |
| 586 OmniboxView* omnibox = GetOmniboxView(); | 589 OmniboxView* omnibox = GetOmniboxView(); |
| 587 return !model_.mode().is_ntp() && omnibox && | 590 return !model_.mode().is_ntp() && omnibox && |
| 588 omnibox->model()->focus_state() == OMNIBOX_FOCUS_VISIBLE; | 591 omnibox->model()->focus_state() == OMNIBOX_FOCUS_VISIBLE; |
| 589 } | 592 } |
| 590 | 593 |
| 591 OmniboxView* SearchTabHelper::GetOmniboxView() const { | 594 OmniboxView* SearchTabHelper::GetOmniboxView() const { |
| 592 return delegate_ ? delegate_->GetOmniboxView() : NULL; | 595 return delegate_ ? delegate_->GetOmniboxView() : NULL; |
| 593 } | 596 } |
| OLD | NEW |