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

Side by Side Diff: chrome/browser/chromeos/certificate_provider/certificate_provider_service_factory.cc

Issue 2257103002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/chromeos/certificate_provider/certificate_provider_serv ice_factory.h" 5 #include "chrome/browser/chromeos/certificate_provider/certificate_provider_serv ice_factory.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 return false; // Behave as if the extension wasn't registered anymore. 137 return false; // Behave as if the extension wasn't registered anymore.
138 } 138 }
139 request.certificate.assign(cert_der.begin(), cert_der.end()); 139 request.certificate.assign(cert_der.begin(), cert_der.end());
140 140
141 std::unique_ptr<base::ListValue> internal_args(new base::ListValue); 141 std::unique_ptr<base::ListValue> internal_args(new base::ListValue);
142 internal_args->AppendInteger(request_id); 142 internal_args->AppendInteger(request_id);
143 internal_args->Append(request.ToValue()); 143 internal_args->Append(request.ToValue());
144 144
145 event_router_->DispatchEventToExtension( 145 event_router_->DispatchEventToExtension(
146 extension_id, 146 extension_id,
147 base::WrapUnique(new extensions::Event( 147 base::MakeUnique<extensions::Event>(
148 extensions::events::CERTIFICATEPROVIDER_ON_SIGN_DIGEST_REQUESTED, 148 extensions::events::CERTIFICATEPROVIDER_ON_SIGN_DIGEST_REQUESTED,
149 event_name, std::move(internal_args)))); 149 event_name, std::move(internal_args)));
150 return true; 150 return true;
151 } 151 }
152 152
153 void DefaultDelegate::OnExtensionUnloaded( 153 void DefaultDelegate::OnExtensionUnloaded(
154 content::BrowserContext* browser_context, 154 content::BrowserContext* browser_context,
155 const extensions::Extension* extension, 155 const extensions::Extension* extension,
156 extensions::UnloadedExtensionInfo::Reason reason) { 156 extensions::UnloadedExtensionInfo::Reason reason) {
157 service_->OnExtensionUnloaded(extension->id()); 157 service_->OnExtensionUnloaded(extension->id());
158 } 158 }
159 159
(...skipping 27 matching lines...) Expand all
187 return chrome::GetBrowserContextRedirectedInIncognito(context); 187 return chrome::GetBrowserContextRedirectedInIncognito(context);
188 } 188 }
189 189
190 bool CertificateProviderServiceFactory::ServiceIsNULLWhileTesting() const { 190 bool CertificateProviderServiceFactory::ServiceIsNULLWhileTesting() const {
191 return true; 191 return true;
192 } 192 }
193 193
194 KeyedService* CertificateProviderServiceFactory::BuildServiceInstanceFor( 194 KeyedService* CertificateProviderServiceFactory::BuildServiceInstanceFor(
195 content::BrowserContext* context) const { 195 content::BrowserContext* context) const {
196 CertificateProviderService* const service = new CertificateProviderService(); 196 CertificateProviderService* const service = new CertificateProviderService();
197 service->SetDelegate(base::WrapUnique(new DefaultDelegate( 197 service->SetDelegate(base::MakeUnique<DefaultDelegate>(
198 service, 198 service,
199 extensions::ExtensionRegistryFactory::GetForBrowserContext(context), 199 extensions::ExtensionRegistryFactory::GetForBrowserContext(context),
200 extensions::EventRouterFactory::GetForBrowserContext(context)))); 200 extensions::EventRouterFactory::GetForBrowserContext(context)));
201 return service; 201 return service;
202 } 202 }
203 203
204 } // namespace chromeos 204 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698