| 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 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 | 431 |
| 432 if (gurl.SchemeIs(content::kChromeUIScheme) && | 432 if (gurl.SchemeIs(content::kChromeUIScheme) && |
| 433 gurl.host() == chrome::kChromeUINewTabHost) { | 433 gurl.host() == chrome::kChromeUINewTabHost) { |
| 434 return AutocompleteInput::NTP; | 434 return AutocompleteInput::NTP; |
| 435 } | 435 } |
| 436 if (url == chrome::kChromeUINativeNewTabURL) { | 436 if (url == chrome::kChromeUINativeNewTabURL) { |
| 437 return focused_from_fakebox ? | 437 return focused_from_fakebox ? |
| 438 AutocompleteInput::INSTANT_NTP_WITH_FAKEBOX_AS_STARTING_FOCUS : | 438 AutocompleteInput::INSTANT_NTP_WITH_FAKEBOX_AS_STARTING_FOCUS : |
| 439 AutocompleteInput::INSTANT_NTP_WITH_OMNIBOX_AS_STARTING_FOCUS; | 439 AutocompleteInput::INSTANT_NTP_WITH_OMNIBOX_AS_STARTING_FOCUS; |
| 440 } | 440 } |
| 441 if (url == content::kAboutBlankURL) | 441 if (url == url::kAboutBlankURL) |
| 442 return AutocompleteInput::BLANK; | 442 return AutocompleteInput::BLANK; |
| 443 | 443 |
| 444 if (url == profile_->GetPrefs()->GetString(prefs::kHomePage)) | 444 if (url == profile_->GetPrefs()->GetString(prefs::kHomePage)) |
| 445 return AutocompleteInput::HOME_PAGE; | 445 return AutocompleteInput::HOME_PAGE; |
| 446 if (is_query_in_omnibox) | 446 if (is_query_in_omnibox) |
| 447 return AutocompleteInput::SEARCH_RESULT_PAGE_DOING_SEARCH_TERM_REPLACEMENT; | 447 return AutocompleteInput::SEARCH_RESULT_PAGE_DOING_SEARCH_TERM_REPLACEMENT; |
| 448 | 448 |
| 449 bool is_search_url = TemplateURLServiceFactory::GetForProfile(profile_)-> | 449 bool is_search_url = TemplateURLServiceFactory::GetForProfile(profile_)-> |
| 450 IsSearchResultsPageFromDefaultSearchProvider(gurl); | 450 IsSearchResultsPageFromDefaultSearchProvider(gurl); |
| 451 if (is_search_url) | 451 if (is_search_url) |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 return; | 499 return; |
| 500 | 500 |
| 501 // ZeroSuggestPrefetcher deletes itself after it's done prefetching. | 501 // ZeroSuggestPrefetcher deletes itself after it's done prefetching. |
| 502 new ZeroSuggestPrefetcher(profile); | 502 new ZeroSuggestPrefetcher(profile); |
| 503 } | 503 } |
| 504 | 504 |
| 505 // Register native methods | 505 // Register native methods |
| 506 bool RegisterAutocompleteControllerAndroid(JNIEnv* env) { | 506 bool RegisterAutocompleteControllerAndroid(JNIEnv* env) { |
| 507 return RegisterNativesImpl(env); | 507 return RegisterNativesImpl(env); |
| 508 } | 508 } |
| OLD | NEW |