Chromium Code Reviews| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
| 10 #include "base/android/jni_array.h" | 10 #include "base/android/jni_array.h" |
| (...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 549 ToJavaIntArray(env, description_class_offsets).obj(), | 549 ToJavaIntArray(env, description_class_offsets).obj(), |
| 550 ToJavaIntArray(env, description_class_styles).obj(), | 550 ToJavaIntArray(env, description_class_styles).obj(), |
| 551 answer_contents.obj(), | 551 answer_contents.obj(), |
| 552 answer_type.obj(), | 552 answer_type.obj(), |
| 553 fill_into_edit.obj(), | 553 fill_into_edit.obj(), |
| 554 destination_url.obj(), | 554 destination_url.obj(), |
| 555 bookmark_model && bookmark_model->IsBookmarked(match.destination_url), | 555 bookmark_model && bookmark_model->IsBookmarked(match.destination_url), |
| 556 match.SupportsDeletion()); | 556 match.SupportsDeletion()); |
| 557 } | 557 } |
| 558 | 558 |
| 559 base::string16 AutocompleteControllerAndroid::FormatURLUsingAcceptLanguages( | 559 base::string16 AutocompleteControllerAndroid::FormatURLUsingAcceptLanguages( |
|
Peter Kasting
2016/04/05 02:42:32
This function name is now inaccurate.
jungshik at Google
2016/04/05 18:56:18
Thanks for catching it.
Turned out that nobody ca
| |
| 560 GURL url) { | 560 GURL url) { |
| 561 if (profile_ == NULL) | |
| 562 return base::string16(); | |
| 563 | |
| 564 std::string languages( | |
| 565 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages)); | |
| 566 | |
| 567 return url_formatter::FormatUrl( | 561 return url_formatter::FormatUrl( |
| 568 url, languages, url_formatter::kFormatUrlOmitAll, | 562 url, url_formatter::kFormatUrlOmitAll, net::UnescapeRule::SPACES, |
| 569 net::UnescapeRule::SPACES, nullptr, nullptr, nullptr); | 563 nullptr, nullptr, nullptr); |
| 570 } | 564 } |
| 571 | 565 |
| 572 ScopedJavaLocalRef<jobject> | 566 ScopedJavaLocalRef<jobject> |
| 573 AutocompleteControllerAndroid::GetTopSynchronousResult( | 567 AutocompleteControllerAndroid::GetTopSynchronousResult( |
| 574 JNIEnv* env, | 568 JNIEnv* env, |
| 575 const JavaRef<jobject>& obj, | 569 const JavaRef<jobject>& obj, |
| 576 const JavaRef<jstring>& j_text, | 570 const JavaRef<jstring>& j_text, |
| 577 bool prevent_inline_autocomplete) { | 571 bool prevent_inline_autocomplete) { |
| 578 if (!autocomplete_controller_) | 572 if (!autocomplete_controller_) |
| 579 return ScopedJavaLocalRef<jobject>(); | 573 return ScopedJavaLocalRef<jobject>(); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 649 return; | 643 return; |
| 650 | 644 |
| 651 // ZeroSuggestPrefetcher deletes itself after it's done prefetching. | 645 // ZeroSuggestPrefetcher deletes itself after it's done prefetching. |
| 652 new ZeroSuggestPrefetcher(profile); | 646 new ZeroSuggestPrefetcher(profile); |
| 653 } | 647 } |
| 654 | 648 |
| 655 // Register native methods | 649 // Register native methods |
| 656 bool RegisterAutocompleteControllerAndroid(JNIEnv* env) { | 650 bool RegisterAutocompleteControllerAndroid(JNIEnv* env) { |
| 657 return RegisterNativesImpl(env); | 651 return RegisterNativesImpl(env); |
| 658 } | 652 } |
| OLD | NEW |