| 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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 | 248 |
| 249 bool SearchTabHelper::SupportsInstant() const { | 249 bool SearchTabHelper::SupportsInstant() const { |
| 250 return model_.instant_support() == INSTANT_SUPPORT_YES; | 250 return model_.instant_support() == INSTANT_SUPPORT_YES; |
| 251 } | 251 } |
| 252 | 252 |
| 253 void SearchTabHelper::SetSuggestionToPrefetch( | 253 void SearchTabHelper::SetSuggestionToPrefetch( |
| 254 const InstantSuggestion& suggestion) { | 254 const InstantSuggestion& suggestion) { |
| 255 ipc_router_.SetSuggestionToPrefetch(suggestion); | 255 ipc_router_.SetSuggestionToPrefetch(suggestion); |
| 256 } | 256 } |
| 257 | 257 |
| 258 void SearchTabHelper::Submit(const base::string16& text) { | 258 void SearchTabHelper::Submit(const base::string16& text, |
| 259 ipc_router_.Submit(text); | 259 const EmbeddedSearchRequestParams& params) { |
| 260 ipc_router_.Submit(text, params); |
| 260 } | 261 } |
| 261 | 262 |
| 262 void SearchTabHelper::OnTabActivated() { | 263 void SearchTabHelper::OnTabActivated() { |
| 263 ipc_router_.OnTabActivated(); | 264 ipc_router_.OnTabActivated(); |
| 264 | 265 |
| 265 OmniboxView* omnibox_view = GetOmniboxView(); | 266 OmniboxView* omnibox_view = GetOmniboxView(); |
| 266 if (chrome::ShouldPrerenderInstantUrlOnOmniboxFocus() && | 267 if (chrome::ShouldPrerenderInstantUrlOnOmniboxFocus() && |
| 267 omnibox_has_focus_fn_(omnibox_view)) { | 268 omnibox_has_focus_fn_(omnibox_view)) { |
| 268 InstantSearchPrerenderer* prerenderer = | 269 InstantSearchPrerenderer* prerenderer = |
| 269 InstantSearchPrerenderer::GetForProfile(profile()); | 270 InstantSearchPrerenderer::GetForProfile(profile()); |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 | 629 |
| 629 bool SearchTabHelper::IsInputInProgress() const { | 630 bool SearchTabHelper::IsInputInProgress() const { |
| 630 OmniboxView* omnibox = GetOmniboxView(); | 631 OmniboxView* omnibox = GetOmniboxView(); |
| 631 return !model_.mode().is_ntp() && omnibox && | 632 return !model_.mode().is_ntp() && omnibox && |
| 632 omnibox->model()->focus_state() == OMNIBOX_FOCUS_VISIBLE; | 633 omnibox->model()->focus_state() == OMNIBOX_FOCUS_VISIBLE; |
| 633 } | 634 } |
| 634 | 635 |
| 635 OmniboxView* SearchTabHelper::GetOmniboxView() const { | 636 OmniboxView* SearchTabHelper::GetOmniboxView() const { |
| 636 return delegate_ ? delegate_->GetOmniboxView() : NULL; | 637 return delegate_ ? delegate_->GetOmniboxView() : NULL; |
| 637 } | 638 } |
| OLD | NEW |