| 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 | 8 | 
| 9 #include <vector> | 9 #include <vector> | 
| 10 | 10 | 
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 323 } | 323 } | 
| 324 | 324 | 
| 325 void AutocompleteActionPredictor::OnOmniboxOpenedUrl( | 325 void AutocompleteActionPredictor::OnOmniboxOpenedUrl( | 
| 326     const AutocompleteLog& log) { | 326     const AutocompleteLog& log) { | 
| 327   if (log.text.length() < kMinimumUserTextLength) | 327   if (log.text.length() < kMinimumUserTextLength) | 
| 328     return; | 328     return; | 
| 329 | 329 | 
| 330   const AutocompleteMatch& match = log.result.match_at(log.selected_index); | 330   const AutocompleteMatch& match = log.result.match_at(log.selected_index); | 
| 331 | 331 | 
| 332   UMA_HISTOGRAM_BOOLEAN( | 332   UMA_HISTOGRAM_BOOLEAN( | 
| 333       StringPrintf("Prerender.OmniboxNavigationsCouldPrerender%s", | 333       base::StringPrintf("Prerender.OmniboxNavigationsCouldPrerender%s", | 
| 334                    prerender::PrerenderManager::GetModeString()).c_str(), | 334                          prerender::PrerenderManager::GetModeString()).c_str(), | 
| 335       prerender::IsOmniboxEnabled(profile_)); | 335       prerender::IsOmniboxEnabled(profile_)); | 
| 336 | 336 | 
| 337   const GURL& opened_url = match.destination_url; | 337   const GURL& opened_url = match.destination_url; | 
| 338   const string16 lower_user_text(base::i18n::ToLower(log.text)); | 338   const string16 lower_user_text(base::i18n::ToLower(log.text)); | 
| 339 | 339 | 
| 340   // Traverse transitional matches for those that have a user_text that is a | 340   // Traverse transitional matches for those that have a user_text that is a | 
| 341   // prefix of |lower_user_text|. | 341   // prefix of |lower_user_text|. | 
| 342   std::vector<AutocompleteActionPredictorTable::Row> rows_to_add; | 342   std::vector<AutocompleteActionPredictorTable::Row> rows_to_add; | 
| 343   std::vector<AutocompleteActionPredictorTable::Row> rows_to_update; | 343   std::vector<AutocompleteActionPredictorTable::Row> rows_to_update; | 
| 344 | 344 | 
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 577   return number_of_hits / (number_of_hits + value.number_of_misses); | 577   return number_of_hits / (number_of_hits + value.number_of_misses); | 
| 578 } | 578 } | 
| 579 | 579 | 
| 580 AutocompleteActionPredictor::TransitionalMatch::TransitionalMatch() { | 580 AutocompleteActionPredictor::TransitionalMatch::TransitionalMatch() { | 
| 581 } | 581 } | 
| 582 | 582 | 
| 583 AutocompleteActionPredictor::TransitionalMatch::~TransitionalMatch() { | 583 AutocompleteActionPredictor::TransitionalMatch::~TransitionalMatch() { | 
| 584 } | 584 } | 
| 585 | 585 | 
| 586 }  // namespace predictors | 586 }  // namespace predictors | 
| OLD | NEW | 
|---|