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

Side by Side Diff: chrome/browser/extensions/api/file_system/file_system_api.cc

Issue 2257113002: 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 (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/extensions/api/file_system/file_system_api.h" 5 #include "chrome/browser/extensions/api/file_system/file_system_api.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <set> 10 #include <set>
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 312
313 ConsentProviderDelegate consent_provider_delegate(profile, nullptr); 313 ConsentProviderDelegate consent_provider_delegate(profile, nullptr);
314 ConsentProvider consent_provider(&consent_provider_delegate); 314 ConsentProvider consent_provider(&consent_provider_delegate);
315 api::file_system::VolumeListChangedEvent event_args; 315 api::file_system::VolumeListChangedEvent event_args;
316 FillVolumeList(profile, &event_args.volumes); 316 FillVolumeList(profile, &event_args.volumes);
317 for (const auto& extension : registry->enabled_extensions()) { 317 for (const auto& extension : registry->enabled_extensions()) {
318 if (!consent_provider.IsGrantable(*extension.get())) 318 if (!consent_provider.IsGrantable(*extension.get()))
319 continue; 319 continue;
320 event_router->DispatchEventToExtension( 320 event_router->DispatchEventToExtension(
321 extension->id(), 321 extension->id(),
322 base::WrapUnique(new Event( 322 base::MakeUnique<Event>(
323 events::FILE_SYSTEM_ON_VOLUME_LIST_CHANGED, 323 events::FILE_SYSTEM_ON_VOLUME_LIST_CHANGED,
324 api::file_system::OnVolumeListChanged::kEventName, 324 api::file_system::OnVolumeListChanged::kEventName,
325 api::file_system::OnVolumeListChanged::Create(event_args)))); 325 api::file_system::OnVolumeListChanged::Create(event_args)));
326 } 326 }
327 } 327 }
328 328
329 ConsentProvider::ConsentProvider(DelegateInterface* delegate) 329 ConsentProvider::ConsentProvider(DelegateInterface* delegate)
330 : delegate_(delegate) { 330 : delegate_(delegate) {
331 DCHECK(delegate_); 331 DCHECK(delegate_);
332 } 332 }
333 333
334 ConsentProvider::~ConsentProvider() { 334 ConsentProvider::~ConsentProvider() {
335 } 335 }
(...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after
1447 return RespondNow(Error(kNotSupportedOnNonKioskSessionError)); 1447 return RespondNow(Error(kNotSupportedOnNonKioskSessionError));
1448 std::vector<api::file_system::Volume> result_volume_list; 1448 std::vector<api::file_system::Volume> result_volume_list;
1449 FillVolumeList(chrome_details_.GetProfile(), &result_volume_list); 1449 FillVolumeList(chrome_details_.GetProfile(), &result_volume_list);
1450 1450
1451 return RespondNow(ArgumentList( 1451 return RespondNow(ArgumentList(
1452 api::file_system::GetVolumeList::Results::Create(result_volume_list))); 1452 api::file_system::GetVolumeList::Results::Create(result_volume_list)));
1453 } 1453 }
1454 #endif 1454 #endif
1455 1455
1456 } // namespace extensions 1456 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698