| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 | 87 |
| 88 // AutocompleteControllerDelegate: | 88 // AutocompleteControllerDelegate: |
| 89 void OnResultChanged(bool default_match_changed) override; | 89 void OnResultChanged(bool default_match_changed) override; |
| 90 | 90 |
| 91 std::unique_ptr<AutocompleteController> controller_; | 91 std::unique_ptr<AutocompleteController> controller_; |
| 92 base::OneShotTimer expire_timer_; | 92 base::OneShotTimer expire_timer_; |
| 93 }; | 93 }; |
| 94 | 94 |
| 95 ZeroSuggestPrefetcher::ZeroSuggestPrefetcher(Profile* profile) | 95 ZeroSuggestPrefetcher::ZeroSuggestPrefetcher(Profile* profile) |
| 96 : controller_(new AutocompleteController( | 96 : controller_(new AutocompleteController( |
| 97 base::WrapUnique(new ChromeAutocompleteProviderClient(profile)), | 97 base::MakeUnique<ChromeAutocompleteProviderClient>(profile), |
| 98 this, | 98 this, |
| 99 AutocompleteProvider::TYPE_ZERO_SUGGEST)) { | 99 AutocompleteProvider::TYPE_ZERO_SUGGEST)) { |
| 100 // Creating an arbitrary fake_request_source to avoid passing in an invalid | 100 // Creating an arbitrary fake_request_source to avoid passing in an invalid |
| 101 // AutocompleteInput object. | 101 // AutocompleteInput object. |
| 102 base::string16 fake_request_source(base::ASCIIToUTF16( | 102 base::string16 fake_request_source(base::ASCIIToUTF16( |
| 103 "http://www.foobarbazblah.com")); | 103 "http://www.foobarbazblah.com")); |
| 104 controller_->Start(AutocompleteInput( | 104 controller_->Start(AutocompleteInput( |
| 105 fake_request_source, base::string16::npos, std::string(), | 105 fake_request_source, base::string16::npos, std::string(), |
| 106 GURL(fake_request_source), OmniboxEventProto::INVALID_SPEC, false, false, | 106 GURL(fake_request_source), OmniboxEventProto::INVALID_SPEC, false, false, |
| 107 true, true, true, ChromeAutocompleteSchemeClassifier(profile))); | 107 true, true, true, ChromeAutocompleteSchemeClassifier(profile))); |
| (...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 return; | 623 return; |
| 624 | 624 |
| 625 // ZeroSuggestPrefetcher deletes itself after it's done prefetching. | 625 // ZeroSuggestPrefetcher deletes itself after it's done prefetching. |
| 626 new ZeroSuggestPrefetcher(profile); | 626 new ZeroSuggestPrefetcher(profile); |
| 627 } | 627 } |
| 628 | 628 |
| 629 // Register native methods | 629 // Register native methods |
| 630 bool RegisterAutocompleteControllerAndroid(JNIEnv* env) { | 630 bool RegisterAutocompleteControllerAndroid(JNIEnv* env) { |
| 631 return RegisterNativesImpl(env); | 631 return RegisterNativesImpl(env); |
| 632 } | 632 } |
| OLD | NEW |