Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Side by Side Diff: chrome/browser/android/omnibox/autocomplete_controller_android.cc

Issue 2334613003: Re-write many calls to WrapUnique() with MakeUnique() (Closed)
Patch Set: Changes from review by sky Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/android/history_report/delta_file_backend_leveldb.cc ('k') | chrome/browser/android/tab_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698