OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/omnibox/omnibox_current_page_delegate_impl.h" | 5 #include "chrome/browser/ui/omnibox/omnibox_current_page_delegate_impl.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/autocomplete/autocomplete_match.h" | 8 #include "chrome/browser/autocomplete/autocomplete_match.h" |
9 #include "chrome/browser/extensions/api/omnibox/omnibox_api.h" | 9 #include "chrome/browser/extensions/api/omnibox/omnibox_api.h" |
10 #include "chrome/browser/predictors/autocomplete_action_predictor.h" | 10 #include "chrome/browser/predictors/autocomplete_action_predictor.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
116 match.destination_url, | 116 match.destination_url, |
117 web_contents->GetController().GetSessionStorageNamespaceMap(), | 117 web_contents->GetController().GetSessionStorageNamespaceMap(), |
118 container_bounds.size()); | 118 container_bounds.size()); |
119 } | 119 } |
120 | 120 |
121 void OmniboxCurrentPageDelegateImpl::SetSuggestionToPrefetch( | 121 void OmniboxCurrentPageDelegateImpl::SetSuggestionToPrefetch( |
122 const InstantSuggestion& suggestion) { | 122 const InstantSuggestion& suggestion) { |
123 content::WebContents* web_contents = controller_->GetWebContents(); | 123 content::WebContents* web_contents = controller_->GetWebContents(); |
124 if (web_contents && | 124 if (web_contents && |
125 SearchTabHelper::FromWebContents(web_contents)->IsSearchResultsPage()) { | 125 SearchTabHelper::FromWebContents(web_contents)->IsSearchResultsPage()) { |
126 if (chrome::ShouldPrefetchSearchResultsOnSRP() || | 126 if (chrome::ShouldPrefetchSearchResultsOnSRP()) { |
127 chrome::ShouldPrefetchSearchResults()) { | |
128 SearchTabHelper::FromWebContents(web_contents)-> | 127 SearchTabHelper::FromWebContents(web_contents)-> |
129 SetSuggestionToPrefetch(suggestion); | 128 SetSuggestionToPrefetch(suggestion); |
130 } | 129 } |
131 } else if (chrome::ShouldPrefetchSearchResults()) { | 130 } else { |
Jered
2014/07/14 16:18:27
Technically, don't you still need to call ShouldPr
kmadhusu
2014/07/14 19:37:15
This function is called only when InstantExtendedA
Jered
2014/07/14 23:23:56
Sure, that's fine.
| |
132 InstantSearchPrerenderer* prerenderer = | 131 InstantSearchPrerenderer* prerenderer = |
133 InstantSearchPrerenderer::GetForProfile(profile_); | 132 InstantSearchPrerenderer::GetForProfile(profile_); |
134 if (prerenderer) | 133 if (prerenderer) |
135 prerenderer->Prerender(suggestion); | 134 prerenderer->Prerender(suggestion); |
136 } | 135 } |
137 } | 136 } |
OLD | NEW |