OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/android/omnibox/omnibox_prerender.h" | 5 #include "chrome/browser/android/omnibox/omnibox_prerender.h" |
6 | 6 |
7 #include "base/android/jni_string.h" | 7 #include "base/android/jni_string.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "chrome/browser/android/tab_android.h" | 9 #include "chrome/browser/android/tab_android.h" |
10 #include "chrome/browser/predictors/autocomplete_action_predictor.h" | 10 #include "chrome/browser/predictors/autocomplete_action_predictor.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 using predictors::AutocompleteActionPredictor; | 21 using predictors::AutocompleteActionPredictor; |
22 using predictors::AutocompleteActionPredictorFactory; | 22 using predictors::AutocompleteActionPredictorFactory; |
23 | 23 |
24 OmniboxPrerender::OmniboxPrerender(JNIEnv* env, jobject obj) | 24 OmniboxPrerender::OmniboxPrerender(JNIEnv* env, jobject obj) |
25 : weak_java_omnibox_(env, obj) { | 25 : weak_java_omnibox_(env, obj) { |
26 } | 26 } |
27 | 27 |
28 OmniboxPrerender::~OmniboxPrerender() { | 28 OmniboxPrerender::~OmniboxPrerender() { |
29 } | 29 } |
30 | 30 |
31 static jlong Init(JNIEnv* env, jobject obj) { | 31 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
32 OmniboxPrerender* omnibox = new OmniboxPrerender(env, obj); | 32 OmniboxPrerender* omnibox = new OmniboxPrerender(env, obj); |
33 return reinterpret_cast<intptr_t>(omnibox); | 33 return reinterpret_cast<intptr_t>(omnibox); |
34 } | 34 } |
35 | 35 |
36 bool RegisterOmniboxPrerender(JNIEnv* env) { | 36 bool RegisterOmniboxPrerender(JNIEnv* env) { |
37 return RegisterNativesImpl(env); | 37 return RegisterNativesImpl(env); |
38 } | 38 } |
39 | 39 |
40 void OmniboxPrerender::Clear(JNIEnv* env, | 40 void OmniboxPrerender::Clear(JNIEnv* env, |
41 jobject obj, | 41 jobject obj, |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 web_contents->GetController().GetDefaultSessionStorageNamespace(), | 150 web_contents->GetController().GetDefaultSessionStorageNamespace(), |
151 container_bounds.size()); | 151 container_bounds.size()); |
152 return; | 152 return; |
153 } | 153 } |
154 predictors::AutocompleteActionPredictorFactory::GetForProfile(profile)-> | 154 predictors::AutocompleteActionPredictorFactory::GetForProfile(profile)-> |
155 StartPrerendering( | 155 StartPrerendering( |
156 match.destination_url, | 156 match.destination_url, |
157 web_contents->GetController().GetDefaultSessionStorageNamespace(), | 157 web_contents->GetController().GetDefaultSessionStorageNamespace(), |
158 container_bounds.size()); | 158 container_bounds.size()); |
159 } | 159 } |
OLD | NEW |