| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/autocomplete/network_action_predictor.h" | 5 #include "chrome/browser/autocomplete/network_action_predictor.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 default: | 282 default: |
| 283 NOTREACHED() << "Unexpected notification observed."; | 283 NOTREACHED() << "Unexpected notification observed."; |
| 284 break; | 284 break; |
| 285 } | 285 } |
| 286 } | 286 } |
| 287 | 287 |
| 288 void NetworkActionPredictor::OnOmniboxOpenedUrl(const AutocompleteLog& log) { | 288 void NetworkActionPredictor::OnOmniboxOpenedUrl(const AutocompleteLog& log) { |
| 289 if (log.text.length() < kMinimumUserTextLength) | 289 if (log.text.length() < kMinimumUserTextLength) |
| 290 return; | 290 return; |
| 291 | 291 |
| 292 UMA_HISTOGRAM_COUNTS("NetworkActionPredictor.NavigationCount_" + |
| 293 prerender::GetOmniboxHistogramSuffix(), 1); |
| 294 |
| 292 const GURL& opened_url = | 295 const GURL& opened_url = |
| 293 log.result.match_at(log.selected_index).destination_url; | 296 log.result.match_at(log.selected_index).destination_url; |
| 294 | 297 |
| 295 const string16 lower_user_text(base::i18n::ToLower(log.text)); | 298 const string16 lower_user_text(base::i18n::ToLower(log.text)); |
| 296 | 299 |
| 297 // Add the current match as the only transitional match. | 300 // Add the current match as the only transitional match. |
| 298 if (prerender::GetOmniboxHeuristicToUse() != | 301 if (prerender::GetOmniboxHeuristicToUse() != |
| 299 prerender::OMNIBOX_HEURISTIC_EXACT_FULL) { | 302 prerender::OMNIBOX_HEURISTIC_EXACT_FULL) { |
| 300 DCHECK(transitional_matches_.empty()); | 303 DCHECK(transitional_matches_.empty()); |
| 301 TransitionalMatch dummy_match; | 304 TransitionalMatch dummy_match; |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 | 520 |
| 518 content::BrowserThread::PostTask(content::BrowserThread::DB, FROM_HERE, | 521 content::BrowserThread::PostTask(content::BrowserThread::DB, FROM_HERE, |
| 519 base::Bind(&NetworkActionPredictorDatabase::CommitTransaction, db_)); | 522 base::Bind(&NetworkActionPredictorDatabase::CommitTransaction, db_)); |
| 520 } | 523 } |
| 521 | 524 |
| 522 NetworkActionPredictor::TransitionalMatch::TransitionalMatch() { | 525 NetworkActionPredictor::TransitionalMatch::TransitionalMatch() { |
| 523 } | 526 } |
| 524 | 527 |
| 525 NetworkActionPredictor::TransitionalMatch::~TransitionalMatch() { | 528 NetworkActionPredictor::TransitionalMatch::~TransitionalMatch() { |
| 526 } | 529 } |
| OLD | NEW |