| 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 <memory> | 7 #include <memory> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 ipc_router_.SetInputInProgress(IsInputInProgress()); | 179 ipc_router_.SetInputInProgress(IsInputInProgress()); |
| 180 } | 180 } |
| 181 | 181 |
| 182 void SearchTabHelper::NavigationEntryUpdated() { | 182 void SearchTabHelper::NavigationEntryUpdated() { |
| 183 if (!is_search_enabled_) | 183 if (!is_search_enabled_) |
| 184 return; | 184 return; |
| 185 | 185 |
| 186 UpdateMode(false); | 186 UpdateMode(false); |
| 187 } | 187 } |
| 188 | 188 |
| 189 bool SearchTabHelper::SupportsInstant() const { | |
| 190 return model_.instant_support() == INSTANT_SUPPORT_YES; | |
| 191 } | |
| 192 | |
| 193 void SearchTabHelper::SetSuggestionToPrefetch( | 189 void SearchTabHelper::SetSuggestionToPrefetch( |
| 194 const InstantSuggestion& suggestion) { | 190 const InstantSuggestion& suggestion) { |
| 195 ipc_router_.SetSuggestionToPrefetch(suggestion); | 191 ipc_router_.SetSuggestionToPrefetch(suggestion); |
| 196 } | 192 } |
| 197 | 193 |
| 198 void SearchTabHelper::Submit(const base::string16& text, | 194 void SearchTabHelper::Submit(const base::string16& text, |
| 199 const EmbeddedSearchRequestParams& params) { | 195 const EmbeddedSearchRequestParams& params) { |
| 200 ipc_router_.Submit(text, params); | 196 ipc_router_.Submit(text, params); |
| 201 } | 197 } |
| 202 | 198 |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 | 501 |
| 506 bool SearchTabHelper::IsInputInProgress() const { | 502 bool SearchTabHelper::IsInputInProgress() const { |
| 507 OmniboxView* omnibox = GetOmniboxView(); | 503 OmniboxView* omnibox = GetOmniboxView(); |
| 508 return !model_.mode().is_ntp() && omnibox && | 504 return !model_.mode().is_ntp() && omnibox && |
| 509 omnibox->model()->focus_state() == OMNIBOX_FOCUS_VISIBLE; | 505 omnibox->model()->focus_state() == OMNIBOX_FOCUS_VISIBLE; |
| 510 } | 506 } |
| 511 | 507 |
| 512 OmniboxView* SearchTabHelper::GetOmniboxView() const { | 508 OmniboxView* SearchTabHelper::GetOmniboxView() const { |
| 513 return delegate_ ? delegate_->GetOmniboxView() : NULL; | 509 return delegate_ ? delegate_->GetOmniboxView() : NULL; |
| 514 } | 510 } |
| OLD | NEW |