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

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

Powered by Google App Engine
This is Rietveld 408576698