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

Side by Side Diff: chrome/browser/ui/views/frame/test_with_browser_view.cc

Issue 2251263003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/ui/views/frame/test_with_browser_view.h" 5 #include "chrome/browser/ui/views/frame/test_with_browser_view.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h" 9 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h"
10 #include "chrome/browser/autocomplete/chrome_autocomplete_provider_client.h" 10 #include "chrome/browser/autocomplete/chrome_autocomplete_provider_client.h"
(...skipping 19 matching lines...) Expand all
30 #if defined(OS_CHROMEOS) 30 #if defined(OS_CHROMEOS)
31 #include "chrome/browser/chromeos/input_method/input_method_configuration.h" 31 #include "chrome/browser/chromeos/input_method/input_method_configuration.h"
32 #include "chrome/browser/chromeos/input_method/mock_input_method_manager.h" 32 #include "chrome/browser/chromeos/input_method/mock_input_method_manager.h"
33 #endif 33 #endif
34 34
35 namespace { 35 namespace {
36 36
37 std::unique_ptr<KeyedService> CreateTemplateURLService( 37 std::unique_ptr<KeyedService> CreateTemplateURLService(
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 TemplateURLService( 40 return base::MakeUnique<TemplateURLService>(
41 profile->GetPrefs(), 41 profile->GetPrefs(),
42 std::unique_ptr<SearchTermsData>(new UIThreadSearchTermsData(profile)), 42 std::unique_ptr<SearchTermsData>(new UIThreadSearchTermsData(profile)),
43 WebDataServiceFactory::GetKeywordWebDataForProfile( 43 WebDataServiceFactory::GetKeywordWebDataForProfile(
44 profile, ServiceAccessType::EXPLICIT_ACCESS), 44 profile, ServiceAccessType::EXPLICIT_ACCESS),
45 std::unique_ptr<TemplateURLServiceClient>( 45 std::unique_ptr<TemplateURLServiceClient>(
46 new ChromeTemplateURLServiceClient( 46 new ChromeTemplateURLServiceClient(
47 HistoryServiceFactory::GetForProfile( 47 HistoryServiceFactory::GetForProfile(
48 profile, ServiceAccessType::EXPLICIT_ACCESS))), 48 profile, ServiceAccessType::EXPLICIT_ACCESS))),
49 nullptr, nullptr, base::Closure())); 49 nullptr, nullptr, base::Closure());
50 } 50 }
51 51
52 std::unique_ptr<KeyedService> CreateAutocompleteClassifier( 52 std::unique_ptr<KeyedService> CreateAutocompleteClassifier(
53 content::BrowserContext* context) { 53 content::BrowserContext* context) {
54 Profile* profile = static_cast<Profile*>(context); 54 Profile* profile = static_cast<Profile*>(context);
55 return base::WrapUnique(new AutocompleteClassifier( 55 return base::MakeUnique<AutocompleteClassifier>(
56 base::WrapUnique(new AutocompleteController( 56 base::WrapUnique(new AutocompleteController(
57 base::WrapUnique(new ChromeAutocompleteProviderClient(profile)), 57 base::WrapUnique(new ChromeAutocompleteProviderClient(profile)),
58 58
59 nullptr, AutocompleteClassifier::kDefaultOmniboxProviders)), 59 nullptr, AutocompleteClassifier::kDefaultOmniboxProviders)),
60 std::unique_ptr<AutocompleteSchemeClassifier>( 60 std::unique_ptr<AutocompleteSchemeClassifier>(
61 new TestSchemeClassifier()))); 61 new TestSchemeClassifier()));
62 } 62 }
63 63
64 } // namespace 64 } // namespace
65 65
66 TestWithBrowserView::TestWithBrowserView() { 66 TestWithBrowserView::TestWithBrowserView() {
67 } 67 }
68 68
69 TestWithBrowserView::TestWithBrowserView(Browser::Type browser_type, 69 TestWithBrowserView::TestWithBrowserView(Browser::Type browser_type,
70 bool hosted_app) 70 bool hosted_app)
71 : BrowserWithTestWindowTest(browser_type, hosted_app) {} 71 : BrowserWithTestWindowTest(browser_type, hosted_app) {}
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 AutocompleteClassifierFactory::GetInstance()->SetTestingFactory( 118 AutocompleteClassifierFactory::GetInstance()->SetTestingFactory(
119 profile, &CreateAutocompleteClassifier); 119 profile, &CreateAutocompleteClassifier);
120 return profile; 120 return profile;
121 } 121 }
122 122
123 BrowserWindow* TestWithBrowserView::CreateBrowserWindow() { 123 BrowserWindow* TestWithBrowserView::CreateBrowserWindow() {
124 // Allow BrowserWithTestWindowTest to use Browser to create the default 124 // Allow BrowserWithTestWindowTest to use Browser to create the default
125 // BrowserView and BrowserFrame. 125 // BrowserView and BrowserFrame.
126 return nullptr; 126 return nullptr;
127 } 127 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/find_bar_view.cc ('k') | chrome/browser/ui/views/infobars/alternate_nav_infobar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698