| 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 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 | 149 |
| 150 void AutocompleteActionPredictor::StartPrerendering( | 150 void AutocompleteActionPredictor::StartPrerendering( |
| 151 const GURL& url, | 151 const GURL& url, |
| 152 content::SessionStorageNamespace* session_storage_namespace, | 152 content::SessionStorageNamespace* session_storage_namespace, |
| 153 const gfx::Size& size) { | 153 const gfx::Size& size) { |
| 154 // Only cancel the old prerender after starting the new one, so if the URLs | 154 // Only cancel the old prerender after starting the new one, so if the URLs |
| 155 // are the same, the underlying prerender will be reused. | 155 // are the same, the underlying prerender will be reused. |
| 156 std::unique_ptr<prerender::PrerenderHandle> old_prerender_handle = | 156 std::unique_ptr<prerender::PrerenderHandle> old_prerender_handle = |
| 157 std::move(prerender_handle_); | 157 std::move(prerender_handle_); |
| 158 prerender::PrerenderManager* prerender_manager = | 158 prerender::PrerenderManager* prerender_manager = |
| 159 prerender::PrerenderManagerFactory::GetForProfile(profile_); | 159 prerender::PrerenderManagerFactory::GetForBrowserContext(profile_); |
| 160 if (prerender_manager) { | 160 if (prerender_manager) { |
| 161 prerender_handle_ = prerender_manager->AddPrerenderFromOmnibox( | 161 prerender_handle_ = prerender_manager->AddPrerenderFromOmnibox( |
| 162 url, session_storage_namespace, size); | 162 url, session_storage_namespace, size); |
| 163 } | 163 } |
| 164 if (old_prerender_handle) | 164 if (old_prerender_handle) |
| 165 old_prerender_handle->OnCancel(); | 165 old_prerender_handle->OnCancel(); |
| 166 } | 166 } |
| 167 | 167 |
| 168 AutocompleteActionPredictor::Action | 168 AutocompleteActionPredictor::Action |
| 169 AutocompleteActionPredictor::RecommendAction( | 169 AutocompleteActionPredictor::RecommendAction( |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 588 AutocompleteActionPredictor::TransitionalMatch::TransitionalMatch() { | 588 AutocompleteActionPredictor::TransitionalMatch::TransitionalMatch() { |
| 589 } | 589 } |
| 590 | 590 |
| 591 AutocompleteActionPredictor::TransitionalMatch::TransitionalMatch( | 591 AutocompleteActionPredictor::TransitionalMatch::TransitionalMatch( |
| 592 const TransitionalMatch& other) = default; | 592 const TransitionalMatch& other) = default; |
| 593 | 593 |
| 594 AutocompleteActionPredictor::TransitionalMatch::~TransitionalMatch() { | 594 AutocompleteActionPredictor::TransitionalMatch::~TransitionalMatch() { |
| 595 } | 595 } |
| 596 | 596 |
| 597 } // namespace predictors | 597 } // namespace predictors |
| OLD | NEW |