| 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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 gurl.host() == chrome::kChromeUINewTabHost) { | 382 gurl.host() == chrome::kChromeUINewTabHost) { |
| 383 return AutocompleteInput::NTP; | 383 return AutocompleteInput::NTP; |
| 384 } | 384 } |
| 385 | 385 |
| 386 if (url == chrome::kChromeUINativeNewTabURL) { | 386 if (url == chrome::kChromeUINativeNewTabURL) { |
| 387 return focused_from_fakebox ? | 387 return focused_from_fakebox ? |
| 388 AutocompleteInput::INSTANT_NTP_WITH_FAKEBOX_AS_STARTING_FOCUS : | 388 AutocompleteInput::INSTANT_NTP_WITH_FAKEBOX_AS_STARTING_FOCUS : |
| 389 AutocompleteInput::INSTANT_NTP_WITH_OMNIBOX_AS_STARTING_FOCUS; | 389 AutocompleteInput::INSTANT_NTP_WITH_OMNIBOX_AS_STARTING_FOCUS; |
| 390 } | 390 } |
| 391 | 391 |
| 392 if (url == content::kAboutBlankURL) | 392 if (url == url::kAboutBlankURL) |
| 393 return AutocompleteInput::BLANK; | 393 return AutocompleteInput::BLANK; |
| 394 | 394 |
| 395 if (url == profile_->GetPrefs()->GetString(prefs::kHomePage)) | 395 if (url == profile_->GetPrefs()->GetString(prefs::kHomePage)) |
| 396 return AutocompleteInput::HOME_PAGE; | 396 return AutocompleteInput::HOME_PAGE; |
| 397 | 397 |
| 398 if (is_query_in_omnibox) | 398 if (is_query_in_omnibox) |
| 399 return AutocompleteInput::SEARCH_RESULT_PAGE_DOING_SEARCH_TERM_REPLACEMENT; | 399 return AutocompleteInput::SEARCH_RESULT_PAGE_DOING_SEARCH_TERM_REPLACEMENT; |
| 400 | 400 |
| 401 bool is_search_url = TemplateURLServiceFactory::GetForProfile(profile_)-> | 401 bool is_search_url = TemplateURLServiceFactory::GetForProfile(profile_)-> |
| 402 IsSearchResultsPageFromDefaultSearchProvider(gurl); | 402 IsSearchResultsPageFromDefaultSearchProvider(gurl); |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 return; | 527 return; |
| 528 | 528 |
| 529 // ZeroSuggestPrefetcher deletes itself after it's done prefetching. | 529 // ZeroSuggestPrefetcher deletes itself after it's done prefetching. |
| 530 new ZeroSuggestPrefetcher(profile); | 530 new ZeroSuggestPrefetcher(profile); |
| 531 } | 531 } |
| 532 | 532 |
| 533 // Register native methods | 533 // Register native methods |
| 534 bool RegisterAutocompleteControllerAndroid(JNIEnv* env) { | 534 bool RegisterAutocompleteControllerAndroid(JNIEnv* env) { |
| 535 return RegisterNativesImpl(env); | 535 return RegisterNativesImpl(env); |
| 536 } | 536 } |
| OLD | NEW |