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()) |
| 171 session_storage_namespace = it->second; |
167 prerender_handle_.reset( | 172 prerender_handle_.reset( |
168 prerender_manager->AddPrerenderFromOmnibox( | 173 prerender_manager->AddPrerenderFromOmnibox( |
169 url, session_storage_namespace, size)); | 174 url, session_storage_namespace, size)); |
170 } else { | 175 } else { |
171 prerender_handle_.reset(); | 176 prerender_handle_.reset(); |
172 } | 177 } |
173 } | 178 } |
174 | 179 |
175 // Given a match, return a recommended action. | 180 // Given a match, return a recommended action. |
176 AutocompleteActionPredictor::Action | 181 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); | 574 return number_of_hits / (number_of_hits + value.number_of_misses); |
570 } | 575 } |
571 | 576 |
572 AutocompleteActionPredictor::TransitionalMatch::TransitionalMatch() { | 577 AutocompleteActionPredictor::TransitionalMatch::TransitionalMatch() { |
573 } | 578 } |
574 | 579 |
575 AutocompleteActionPredictor::TransitionalMatch::~TransitionalMatch() { | 580 AutocompleteActionPredictor::TransitionalMatch::~TransitionalMatch() { |
576 } | 581 } |
577 | 582 |
578 } // namespace predictors | 583 } // namespace predictors |
OLD | NEW |