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

Side by Side Diff: chrome/browser/chromeos/extensions/file_manager/private_api_misc.cc

Issue 1077823005: Declare providing extension capabilities in the manifest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed gn. Created 5 years, 8 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/chromeos/extensions/file_manager/private_api_misc.h" 5 #include "chrome/browser/chromeos/extensions/file_manager/private_api_misc.h"
6 6
7 #include "ash/frame/frame_util.h" 7 #include "ash/frame/frame_util.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 const std::vector<ProvidingExtensionInfo> info_list = 484 const std::vector<ProvidingExtensionInfo> info_list =
485 service->GetProvidingExtensionInfoList(); 485 service->GetProvidingExtensionInfoList();
486 486
487 using api::file_manager_private::ProvidingExtension; 487 using api::file_manager_private::ProvidingExtension;
488 std::vector<linked_ptr<ProvidingExtension>> providing_extensions; 488 std::vector<linked_ptr<ProvidingExtension>> providing_extensions;
489 for (const auto& info : info_list) { 489 for (const auto& info : info_list) {
490 const linked_ptr<ProvidingExtension> providing_extension( 490 const linked_ptr<ProvidingExtension> providing_extension(
491 new ProvidingExtension); 491 new ProvidingExtension);
492 providing_extension->extension_id = info.extension_id; 492 providing_extension->extension_id = info.extension_id;
493 providing_extension->name = info.name; 493 providing_extension->name = info.name;
494 providing_extension->can_configure = info.can_configure; 494 providing_extension->configurable = info.capabilities.configurable();
495 providing_extension->can_add = info.can_add; 495 providing_extension->multiple_mounts = info.capabilities.multiple_mounts();
496 providing_extension->multiple_mounts = info.capabilities.multiple_mounts();
not at google - send to devlin 2015/04/24 16:18:32 assigning this twice?
mtomasz 2015/04/24 17:12:10 Done.
497 switch (info.capabilities.source()) {
498 case SOURCE_FILE:
499 providing_extension->source = api::file_system_provider::SOURCE_FILE;
500 break;
501 case SOURCE_DEVICE:
502 providing_extension->source = api::file_system_provider::SOURCE_DEVICE;
503 break;
504 case SOURCE_NETWORK:
505 providing_extension->source = api::file_system_provider::SOURCE_NETWORK;
506 break;
507 }
496 providing_extensions.push_back(providing_extension); 508 providing_extensions.push_back(providing_extension);
497 } 509 }
498 510
499 return RespondNow(ArgumentList( 511 return RespondNow(ArgumentList(
500 api::file_manager_private::GetProvidingExtensions::Results::Create( 512 api::file_manager_private::GetProvidingExtensions::Results::Create(
501 providing_extensions).Pass())); 513 providing_extensions).Pass()));
502 } 514 }
503 515
504 FileManagerPrivateAddProvidedFileSystemFunction:: 516 FileManagerPrivateAddProvidedFileSystemFunction::
505 FileManagerPrivateAddProvidedFileSystemFunction() 517 FileManagerPrivateAddProvidedFileSystemFunction()
(...skipping 25 matching lines...) Expand all
531 FileManagerPrivateConfigureProvidedFileSystemFunction::Run() { 543 FileManagerPrivateConfigureProvidedFileSystemFunction::Run() {
532 using extensions::api::file_manager_private::ConfigureProvidedFileSystem:: 544 using extensions::api::file_manager_private::ConfigureProvidedFileSystem::
533 Params; 545 Params;
534 const scoped_ptr<Params> params(Params::Create(*args_)); 546 const scoped_ptr<Params> params(Params::Create(*args_));
535 EXTENSION_FUNCTION_VALIDATE(params); 547 EXTENSION_FUNCTION_VALIDATE(params);
536 548
537 using file_manager::VolumeManager; 549 using file_manager::VolumeManager;
538 using file_manager::Volume; 550 using file_manager::Volume;
539 VolumeManager* const volume_manager = 551 VolumeManager* const volume_manager =
540 VolumeManager::Get(chrome_details_.GetProfile()); 552 VolumeManager::Get(chrome_details_.GetProfile());
541 LOG(ERROR) << "LOOKING FOR: " << params->volume_id;
542 base::WeakPtr<Volume> volume = 553 base::WeakPtr<Volume> volume =
543 volume_manager->FindVolumeById(params->volume_id); 554 volume_manager->FindVolumeById(params->volume_id);
544 if (!volume.get()) 555 if (!volume.get())
545 return RespondNow(Error("Volume not found.")); 556 return RespondNow(Error("Volume not found."));
546 557
547 using chromeos::file_system_provider::Service; 558 using chromeos::file_system_provider::Service;
548 Service* const service = Service::Get(chrome_details_.GetProfile()); 559 Service* const service = Service::Get(chrome_details_.GetProfile());
549 DCHECK(service); 560 DCHECK(service);
550 561
551 using chromeos::file_system_provider::ProvidedFileSystemInterface; 562 using chromeos::file_system_provider::ProvidedFileSystemInterface;
(...skipping 12 matching lines...) Expand all
564 base::File::Error result) { 575 base::File::Error result) {
565 if (result != base::File::FILE_OK) { 576 if (result != base::File::FILE_OK) {
566 Respond(Error("Failed to complete configuration.")); 577 Respond(Error("Failed to complete configuration."));
567 return; 578 return;
568 } 579 }
569 580
570 Respond(NoArguments()); 581 Respond(NoArguments());
571 } 582 }
572 583
573 } // namespace extensions 584 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698