| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/autocomplete_controller_android.h" | 5 #include "chrome/browser/android/omnibox/autocomplete_controller_android.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 Profile* profile, JNIEnv* env, jobject obj) { | 288 Profile* profile, JNIEnv* env, jobject obj) { |
| 289 AutocompleteControllerAndroid* bridge = | 289 AutocompleteControllerAndroid* bridge = |
| 290 static_cast<AutocompleteControllerAndroid*>( | 290 static_cast<AutocompleteControllerAndroid*>( |
| 291 GetInstance()->GetServiceForBrowserContext(profile, true)); | 291 GetInstance()->GetServiceForBrowserContext(profile, true)); |
| 292 bridge->InitJNI(env, obj); | 292 bridge->InitJNI(env, obj); |
| 293 return bridge; | 293 return bridge; |
| 294 } | 294 } |
| 295 | 295 |
| 296 AutocompleteControllerAndroid::Factory* | 296 AutocompleteControllerAndroid::Factory* |
| 297 AutocompleteControllerAndroid::Factory::GetInstance() { | 297 AutocompleteControllerAndroid::Factory::GetInstance() { |
| 298 return Singleton<AutocompleteControllerAndroid::Factory>::get(); | 298 return base::Singleton<AutocompleteControllerAndroid::Factory>::get(); |
| 299 } | 299 } |
| 300 | 300 |
| 301 content::BrowserContext* | 301 content::BrowserContext* |
| 302 AutocompleteControllerAndroid::Factory::GetBrowserContextToUse( | 302 AutocompleteControllerAndroid::Factory::GetBrowserContextToUse( |
| 303 content::BrowserContext* context) const { | 303 content::BrowserContext* context) const { |
| 304 return chrome::GetBrowserContextOwnInstanceInIncognito(context); | 304 return chrome::GetBrowserContextOwnInstanceInIncognito(context); |
| 305 } | 305 } |
| 306 | 306 |
| 307 AutocompleteControllerAndroid::Factory::Factory() | 307 AutocompleteControllerAndroid::Factory::Factory() |
| 308 : BrowserContextKeyedServiceFactory( | 308 : BrowserContextKeyedServiceFactory( |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 return; | 559 return; |
| 560 | 560 |
| 561 // ZeroSuggestPrefetcher deletes itself after it's done prefetching. | 561 // ZeroSuggestPrefetcher deletes itself after it's done prefetching. |
| 562 new ZeroSuggestPrefetcher(profile); | 562 new ZeroSuggestPrefetcher(profile); |
| 563 } | 563 } |
| 564 | 564 |
| 565 // Register native methods | 565 // Register native methods |
| 566 bool RegisterAutocompleteControllerAndroid(JNIEnv* env) { | 566 bool RegisterAutocompleteControllerAndroid(JNIEnv* env) { |
| 567 return RegisterNativesImpl(env); | 567 return RegisterNativesImpl(env); |
| 568 } | 568 } |
| OLD | NEW |