Chromium Code Reviews| 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 151 } | 151 } |
| 152 } | 152 } |
| 153 } | 153 } |
| 154 | 154 |
| 155 void AutocompleteActionPredictor::ClearTransitionalMatches() { | 155 void AutocompleteActionPredictor::ClearTransitionalMatches() { |
| 156 transitional_matches_.clear(); | 156 transitional_matches_.clear(); |
| 157 } | 157 } |
| 158 | 158 |
| 159 void AutocompleteActionPredictor::StartPrerendering( | 159 void AutocompleteActionPredictor::StartPrerendering( |
| 160 const GURL& url, | 160 const GURL& url, |
| 161 content::SessionStorageNamespace* session_storage_namespace, | 161 const content::SessionStorageNamespaceMap& session_storage_namespace_map, |
| 162 const gfx::Size& size) { | 162 const gfx::Size& size) { |
| 163 if (prerender_handle_.get()) | 163 if (prerender_handle_.get()) |
| 164 prerender_handle_->OnNavigateAway(); | 164 prerender_handle_->OnNavigateAway(); |
| 165 if (prerender::PrerenderManager* prerender_manager = | 165 if (prerender::PrerenderManager* prerender_manager = |
| 166 prerender::PrerenderManagerFactory::GetForProfile(profile_)) { | 166 prerender::PrerenderManagerFactory::GetForProfile(profile_)) { |
| 167 content::SessionStorageNamespace* session_storage_namespace = NULL; | |
| 168 content::SessionStorageNamespaceMap::const_iterator it = | |
| 169 session_storage_namespace_map.find(""); | |
| 170 if (it != session_storage_namespace_map.end()) { | |
|
Charlie Reis
2012/08/06 20:38:30
nit: No braces.
awong
2012/08/08 18:08:28
Done.
| |
| 171 session_storage_namespace = it->second; | |
| 172 } | |
| 167 prerender_handle_.reset( | 173 prerender_handle_.reset( |
| 168 prerender_manager->AddPrerenderFromOmnibox( | 174 prerender_manager->AddPrerenderFromOmnibox( |
| 169 url, session_storage_namespace, size)); | 175 url, session_storage_namespace, size)); |
| 170 } else { | 176 } else { |
| 171 prerender_handle_.reset(); | 177 prerender_handle_.reset(); |
| 172 } | 178 } |
| 173 } | 179 } |
| 174 | 180 |
| 175 // Given a match, return a recommended action. | 181 // Given a match, return a recommended action. |
| 176 AutocompleteActionPredictor::Action | 182 AutocompleteActionPredictor::Action |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 569 return number_of_hits / (number_of_hits + value.number_of_misses); | 575 return number_of_hits / (number_of_hits + value.number_of_misses); |
| 570 } | 576 } |
| 571 | 577 |
| 572 AutocompleteActionPredictor::TransitionalMatch::TransitionalMatch() { | 578 AutocompleteActionPredictor::TransitionalMatch::TransitionalMatch() { |
| 573 } | 579 } |
| 574 | 580 |
| 575 AutocompleteActionPredictor::TransitionalMatch::~TransitionalMatch() { | 581 AutocompleteActionPredictor::TransitionalMatch::~TransitionalMatch() { |
| 576 } | 582 } |
| 577 | 583 |
| 578 } // namespace predictors | 584 } // namespace predictors |
| OLD | NEW |