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/predictors/autocomplete_action_predictor.h" | 5 #include "chrome/browser/predictors/autocomplete_action_predictor.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 | 239 |
240 // Abandon the current prerender. If it is to be used, it will be used very | 240 // Abandon the current prerender. If it is to be used, it will be used very |
241 // soon, so use the lower timeout. | 241 // soon, so use the lower timeout. |
242 if (prerender_handle_) { | 242 if (prerender_handle_) { |
243 prerender_handle_->OnNavigateAway(); | 243 prerender_handle_->OnNavigateAway(); |
244 // Don't release |prerender_handle_| so it is canceled if it survives to the | 244 // Don't release |prerender_handle_| so it is canceled if it survives to the |
245 // next StartPrerendering call. | 245 // next StartPrerendering call. |
246 } | 246 } |
247 | 247 |
248 UMA_HISTOGRAM_BOOLEAN( | 248 UMA_HISTOGRAM_BOOLEAN( |
249 base::StringPrintf("Prerender.OmniboxNavigationsCouldPrerender%s", | 249 "Prerender.OmniboxNavigationsCouldPrerender", |
250 prerender::PrerenderManager::GetModeString()).c_str(), | |
251 prerender::IsOmniboxEnabled(profile_)); | 250 prerender::IsOmniboxEnabled(profile_)); |
252 | 251 |
253 const AutocompleteMatch& match = log.result.match_at(log.selected_index); | 252 const AutocompleteMatch& match = log.result.match_at(log.selected_index); |
254 const GURL& opened_url = match.destination_url; | 253 const GURL& opened_url = match.destination_url; |
255 const base::string16 lower_user_text(base::i18n::ToLower(log.text)); | 254 const base::string16 lower_user_text(base::i18n::ToLower(log.text)); |
256 | 255 |
257 // Traverse transitional matches for those that have a user_text that is a | 256 // Traverse transitional matches for those that have a user_text that is a |
258 // prefix of |lower_user_text|. | 257 // prefix of |lower_user_text|. |
259 std::vector<AutocompleteActionPredictorTable::Row> rows_to_add; | 258 std::vector<AutocompleteActionPredictorTable::Row> rows_to_add; |
260 std::vector<AutocompleteActionPredictorTable::Row> rows_to_update; | 259 std::vector<AutocompleteActionPredictorTable::Row> rows_to_update; |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 AutocompleteActionPredictor::TransitionalMatch::TransitionalMatch() { | 588 AutocompleteActionPredictor::TransitionalMatch::TransitionalMatch() { |
590 } | 589 } |
591 | 590 |
592 AutocompleteActionPredictor::TransitionalMatch::TransitionalMatch( | 591 AutocompleteActionPredictor::TransitionalMatch::TransitionalMatch( |
593 const TransitionalMatch& other) = default; | 592 const TransitionalMatch& other) = default; |
594 | 593 |
595 AutocompleteActionPredictor::TransitionalMatch::~TransitionalMatch() { | 594 AutocompleteActionPredictor::TransitionalMatch::~TransitionalMatch() { |
596 } | 595 } |
597 | 596 |
598 } // namespace predictors | 597 } // namespace predictors |
OLD | NEW |