OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/omnibox/omnibox_edit_model.h" | 5 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1158 // It's possible the tab strip does not have an active tab contents, for | 1158 // It's possible the tab strip does not have an active tab contents, for |
1159 // instance if the tab has been closed or on return from a sleep state | 1159 // instance if the tab has been closed or on return from a sleep state |
1160 // (http://crbug.com/105689) | 1160 // (http://crbug.com/105689) |
1161 TabContents* tab = controller_->GetTabContents(); | 1161 TabContents* tab = controller_->GetTabContents(); |
1162 if (!tab) | 1162 if (!tab) |
1163 return; | 1163 return; |
1164 gfx::Rect container_bounds; | 1164 gfx::Rect container_bounds; |
1165 tab->web_contents()->GetView()->GetContainerBounds(&container_bounds); | 1165 tab->web_contents()->GetView()->GetContainerBounds(&container_bounds); |
1166 AutocompleteActionPredictorFactory::GetForProfile(profile_)-> | 1166 AutocompleteActionPredictorFactory::GetForProfile(profile_)-> |
1167 StartPrerendering(match.destination_url, | 1167 StartPrerendering(match.destination_url, |
1168 tab->web_contents()->GetRenderViewHost()-> | 1168 tab->web_contents()->GetController() |
1169 GetSessionStorageNamespace(), | 1169 .GetSessionStorageNamespaceMap(), |
1170 container_bounds.size()); | 1170 container_bounds.size()); |
1171 } | 1171 } |
1172 | 1172 |
1173 void OmniboxEditModel::DoPreconnect(const AutocompleteMatch& match) { | 1173 void OmniboxEditModel::DoPreconnect(const AutocompleteMatch& match) { |
1174 if (!match.destination_url.SchemeIs(chrome::kExtensionScheme)) { | 1174 if (!match.destination_url.SchemeIs(chrome::kExtensionScheme)) { |
1175 // Warm up DNS Prefetch cache, or preconnect to a search service. | 1175 // Warm up DNS Prefetch cache, or preconnect to a search service. |
1176 UMA_HISTOGRAM_ENUMERATION("Autocomplete.MatchType", match.type, | 1176 UMA_HISTOGRAM_ENUMERATION("Autocomplete.MatchType", match.type, |
1177 AutocompleteMatch::NUM_TYPES); | 1177 AutocompleteMatch::NUM_TYPES); |
1178 if (profile_->GetNetworkPredictor()) { | 1178 if (profile_->GetNetworkPredictor()) { |
1179 profile_->GetNetworkPredictor()->AnticipateOmniboxUrl( | 1179 profile_->GetNetworkPredictor()->AnticipateOmniboxUrl( |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1212 } | 1212 } |
1213 | 1213 |
1214 void OmniboxEditModel::ClassifyStringForPasteAndGo( | 1214 void OmniboxEditModel::ClassifyStringForPasteAndGo( |
1215 const string16& text, | 1215 const string16& text, |
1216 AutocompleteMatch* match, | 1216 AutocompleteMatch* match, |
1217 GURL* alternate_nav_url) const { | 1217 GURL* alternate_nav_url) const { |
1218 DCHECK(match); | 1218 DCHECK(match); |
1219 AutocompleteClassifierFactory::GetForProfile(profile_)->Classify(text, | 1219 AutocompleteClassifierFactory::GetForProfile(profile_)->Classify(text, |
1220 string16(), false, false, match, alternate_nav_url); | 1220 string16(), false, false, match, alternate_nav_url); |
1221 } | 1221 } |
OLD | NEW |