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

Unified Diff: chrome/browser/ui/views/frame/test_with_browser_view.cc

Issue 1165913002: [Cleanup] Used scoped pointers in KeyedServiceFactory's SetTestingFactory functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Finish renaming profile -> context Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/frame/test_with_browser_view.cc
diff --git a/chrome/browser/ui/views/frame/test_with_browser_view.cc b/chrome/browser/ui/views/frame/test_with_browser_view.cc
index 843c172042b5b9cd701da69550dd90ef94627c7b..5a284b11c083a6a40cc3e5be02a21021a78a5820 100644
--- a/chrome/browser/ui/views/frame/test_with_browser_view.cc
+++ b/chrome/browser/ui/views/frame/test_with_browser_view.cc
@@ -31,10 +31,10 @@
namespace {
-// Caller owns the returned service.
-KeyedService* CreateTemplateURLService(content::BrowserContext* context) {
+scoped_ptr<KeyedService> CreateTemplateURLService(
+ content::BrowserContext* context) {
Profile* profile = static_cast<Profile*>(context);
- return new TemplateURLService(
+ return make_scoped_ptr(new TemplateURLService(
profile->GetPrefs(),
scoped_ptr<SearchTermsData>(new UIThreadSearchTermsData(profile)),
WebDataServiceFactory::GetKeywordWebDataForProfile(
@@ -42,16 +42,17 @@ KeyedService* CreateTemplateURLService(content::BrowserContext* context) {
scoped_ptr<TemplateURLServiceClient>(new ChromeTemplateURLServiceClient(
HistoryServiceFactory::GetForProfile(
profile, ServiceAccessType::EXPLICIT_ACCESS))),
- nullptr, nullptr, base::Closure());
+ nullptr, nullptr, base::Closure()));
}
-KeyedService* CreateAutocompleteClassifier(content::BrowserContext* context) {
+scoped_ptr<KeyedService> CreateAutocompleteClassifier(
+ content::BrowserContext* context) {
Profile* profile = static_cast<Profile*>(context);
- return new AutocompleteClassifier(
+ return make_scoped_ptr(new AutocompleteClassifier(
make_scoped_ptr(new AutocompleteController(
profile, TemplateURLServiceFactory::GetForProfile(profile), nullptr,
AutocompleteClassifier::kDefaultOmniboxProviders)),
- scoped_ptr<AutocompleteSchemeClassifier>(new TestSchemeClassifier()));
+ scoped_ptr<AutocompleteSchemeClassifier>(new TestSchemeClassifier())));
}
} // namespace

Powered by Google App Engine
This is Rietveld 408576698