| 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 jboolean focused_from_fakebox) { | 178 jboolean focused_from_fakebox) { |
| 179 if (!autocomplete_controller_) | 179 if (!autocomplete_controller_) |
| 180 return; | 180 return; |
| 181 | 181 |
| 182 base::string16 url = ConvertJavaStringToUTF16(env, j_current_url); | 182 base::string16 url = ConvertJavaStringToUTF16(env, j_current_url); |
| 183 const GURL current_url = GURL(url); | 183 const GURL current_url = GURL(url); |
| 184 base::string16 omnibox_text = ConvertJavaStringToUTF16(env, j_omnibox_text); | 184 base::string16 omnibox_text = ConvertJavaStringToUTF16(env, j_omnibox_text); |
| 185 | 185 |
| 186 // If omnibox text is empty, set it to the current URL for the purposes of | 186 // If omnibox text is empty, set it to the current URL for the purposes of |
| 187 // populating the verbatim match. | 187 // populating the verbatim match. |
| 188 if (omnibox_text.empty()) | 188 if (omnibox_text.empty() && |
| 189 !current_url.SchemeIs(content::kChromeUIScheme) && |
| 190 !current_url.SchemeIs(chrome::kChromeUINativeScheme)) |
| 189 omnibox_text = url; | 191 omnibox_text = url; |
| 190 | 192 |
| 191 input_ = AutocompleteInput( | 193 input_ = AutocompleteInput( |
| 192 omnibox_text, base::string16::npos, std::string(), current_url, | 194 omnibox_text, base::string16::npos, std::string(), current_url, |
| 193 ClassifyPage(current_url, focused_from_fakebox), | 195 ClassifyPage(current_url, focused_from_fakebox), |
| 194 false, false, true, true, true, | 196 false, false, true, true, true, |
| 195 ChromeAutocompleteSchemeClassifier(profile_)); | 197 ChromeAutocompleteSchemeClassifier(profile_)); |
| 196 autocomplete_controller_->Start(input_); | 198 autocomplete_controller_->Start(input_); |
| 197 } | 199 } |
| 198 | 200 |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 return; | 597 return; |
| 596 | 598 |
| 597 // ZeroSuggestPrefetcher deletes itself after it's done prefetching. | 599 // ZeroSuggestPrefetcher deletes itself after it's done prefetching. |
| 598 new ZeroSuggestPrefetcher(profile); | 600 new ZeroSuggestPrefetcher(profile); |
| 599 } | 601 } |
| 600 | 602 |
| 601 // Register native methods | 603 // Register native methods |
| 602 bool RegisterAutocompleteControllerAndroid(JNIEnv* env) { | 604 bool RegisterAutocompleteControllerAndroid(JNIEnv* env) { |
| 603 return RegisterNativesImpl(env); | 605 return RegisterNativesImpl(env); |
| 604 } | 606 } |
| OLD | NEW |