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

Side by Side Diff: chrome/browser/autocomplete/autocomplete_classifier_factory.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/autocomplete/autocomplete_classifier_factory.h" 5 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "chrome/browser/autocomplete/chrome_autocomplete_provider_client.h" 8 #include "chrome/browser/autocomplete/chrome_autocomplete_provider_client.h"
9 #include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h" 9 #include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h"
10 #include "chrome/browser/autocomplete/in_memory_url_index_factory.h" 10 #include "chrome/browser/autocomplete/in_memory_url_index_factory.h"
(...skipping 19 matching lines...) Expand all
30 30
31 // static 31 // static
32 AutocompleteClassifierFactory* AutocompleteClassifierFactory::GetInstance() { 32 AutocompleteClassifierFactory* AutocompleteClassifierFactory::GetInstance() {
33 return base::Singleton<AutocompleteClassifierFactory>::get(); 33 return base::Singleton<AutocompleteClassifierFactory>::get();
34 } 34 }
35 35
36 // static 36 // static
37 std::unique_ptr<KeyedService> AutocompleteClassifierFactory::BuildInstanceFor( 37 std::unique_ptr<KeyedService> AutocompleteClassifierFactory::BuildInstanceFor(
38 content::BrowserContext* context) { 38 content::BrowserContext* context) {
39 Profile* profile = static_cast<Profile*>(context); 39 Profile* profile = static_cast<Profile*>(context);
40 return base::WrapUnique(new AutocompleteClassifier( 40 return base::MakeUnique<AutocompleteClassifier>(
41 base::WrapUnique(new AutocompleteController( 41 base::WrapUnique(new AutocompleteController(
42 base::WrapUnique(new ChromeAutocompleteProviderClient(profile)), NULL, 42 base::WrapUnique(new ChromeAutocompleteProviderClient(profile)), NULL,
43 AutocompleteClassifier::kDefaultOmniboxProviders)), 43 AutocompleteClassifier::kDefaultOmniboxProviders)),
44 std::unique_ptr<AutocompleteSchemeClassifier>( 44 std::unique_ptr<AutocompleteSchemeClassifier>(
45 new ChromeAutocompleteSchemeClassifier(profile)))); 45 new ChromeAutocompleteSchemeClassifier(profile)));
46 } 46 }
47 47
48 AutocompleteClassifierFactory::AutocompleteClassifierFactory() 48 AutocompleteClassifierFactory::AutocompleteClassifierFactory()
49 : BrowserContextKeyedServiceFactory( 49 : BrowserContextKeyedServiceFactory(
50 "AutocompleteClassifier", 50 "AutocompleteClassifier",
51 BrowserContextDependencyManager::GetInstance()) { 51 BrowserContextDependencyManager::GetInstance()) {
52 #if defined(ENABLE_EXTENSIONS) 52 #if defined(ENABLE_EXTENSIONS)
53 DependsOn( 53 DependsOn(
54 extensions::ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); 54 extensions::ExtensionsBrowserClient::Get()->GetExtensionSystemFactory());
55 #endif 55 #endif
(...skipping 13 matching lines...) Expand all
69 } 69 }
70 70
71 bool AutocompleteClassifierFactory::ServiceIsNULLWhileTesting() const { 71 bool AutocompleteClassifierFactory::ServiceIsNULLWhileTesting() const {
72 return true; 72 return true;
73 } 73 }
74 74
75 KeyedService* AutocompleteClassifierFactory::BuildServiceInstanceFor( 75 KeyedService* AutocompleteClassifierFactory::BuildServiceInstanceFor(
76 content::BrowserContext* profile) const { 76 content::BrowserContext* profile) const {
77 return BuildInstanceFor(static_cast<Profile*>(profile)).release(); 77 return BuildInstanceFor(static_cast<Profile*>(profile)).release();
78 } 78 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698