| 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 } | 133 } |
| 134 | 134 |
| 135 void AutocompleteActionPredictor::ClearTransitionalMatches() { | 135 void AutocompleteActionPredictor::ClearTransitionalMatches() { |
| 136 transitional_matches_.clear(); | 136 transitional_matches_.clear(); |
| 137 } | 137 } |
| 138 | 138 |
| 139 void AutocompleteActionPredictor::StartPrerendering( | 139 void AutocompleteActionPredictor::StartPrerendering( |
| 140 const GURL& url, | 140 const GURL& url, |
| 141 const content::SessionStorageNamespaceMap& session_storage_namespace_map, | 141 const content::SessionStorageNamespaceMap& session_storage_namespace_map, |
| 142 const gfx::Size& size) { | 142 const gfx::Size& size) { |
| 143 if (prerender_handle_.get()) | 143 if (prerender_handle_) |
| 144 prerender_handle_->OnNavigateAway(); | 144 prerender_handle_->OnCancel(); |
| 145 if (prerender::PrerenderManager* prerender_manager = | 145 if (prerender::PrerenderManager* prerender_manager = |
| 146 prerender::PrerenderManagerFactory::GetForProfile(profile_)) { | 146 prerender::PrerenderManagerFactory::GetForProfile(profile_)) { |
| 147 content::SessionStorageNamespace* session_storage_namespace = NULL; | 147 content::SessionStorageNamespace* session_storage_namespace = NULL; |
| 148 content::SessionStorageNamespaceMap::const_iterator it = | 148 content::SessionStorageNamespaceMap::const_iterator it = |
| 149 session_storage_namespace_map.find(""); | 149 session_storage_namespace_map.find(""); |
| 150 if (it != session_storage_namespace_map.end()) | 150 if (it != session_storage_namespace_map.end()) |
| 151 session_storage_namespace = it->second; | 151 session_storage_namespace = it->second; |
| 152 prerender_handle_.reset( | 152 prerender_handle_.reset( |
| 153 prerender_manager->AddPrerenderFromOmnibox( | 153 prerender_manager->AddPrerenderFromOmnibox( |
| 154 url, session_storage_namespace, size)); | 154 url, session_storage_namespace, size)); |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 return number_of_hits / (number_of_hits + value.number_of_misses); | 575 return number_of_hits / (number_of_hits + value.number_of_misses); |
| 576 } | 576 } |
| 577 | 577 |
| 578 AutocompleteActionPredictor::TransitionalMatch::TransitionalMatch() { | 578 AutocompleteActionPredictor::TransitionalMatch::TransitionalMatch() { |
| 579 } | 579 } |
| 580 | 580 |
| 581 AutocompleteActionPredictor::TransitionalMatch::~TransitionalMatch() { | 581 AutocompleteActionPredictor::TransitionalMatch::~TransitionalMatch() { |
| 582 } | 582 } |
| 583 | 583 |
| 584 } // namespace predictors | 584 } // namespace predictors |
| OLD | NEW |