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

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. 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 switch (info.capabilities.source()) {
not at google - send to devlin 2015/04/24 17:49:30 providing_extension->source and info.capabilities.
mtomasz 2015/05/07 03:33:59 They are not the same. I convert the generated typ
497 case SOURCE_FILE:
498 providing_extension->source = api::file_system_provider::SOURCE_FILE;
499 break;
500 case SOURCE_DEVICE:
501 providing_extension->source = api::file_system_provider::SOURCE_DEVICE;
502 break;
503 case SOURCE_NETWORK:
504 providing_extension->source = api::file_system_provider::SOURCE_NETWORK;
505 break;
506 }
496 providing_extensions.push_back(providing_extension); 507 providing_extensions.push_back(providing_extension);
497 } 508 }
498 509
499 return RespondNow(ArgumentList( 510 return RespondNow(ArgumentList(
500 api::file_manager_private::GetProvidingExtensions::Results::Create( 511 api::file_manager_private::GetProvidingExtensions::Results::Create(
501 providing_extensions).Pass())); 512 providing_extensions).Pass()));
502 } 513 }
503 514
504 FileManagerPrivateAddProvidedFileSystemFunction:: 515 FileManagerPrivateAddProvidedFileSystemFunction::
505 FileManagerPrivateAddProvidedFileSystemFunction() 516 FileManagerPrivateAddProvidedFileSystemFunction()
(...skipping 25 matching lines...) Expand all
531 FileManagerPrivateConfigureProvidedFileSystemFunction::Run() { 542 FileManagerPrivateConfigureProvidedFileSystemFunction::Run() {
532 using extensions::api::file_manager_private::ConfigureProvidedFileSystem:: 543 using extensions::api::file_manager_private::ConfigureProvidedFileSystem::
533 Params; 544 Params;
534 const scoped_ptr<Params> params(Params::Create(*args_)); 545 const scoped_ptr<Params> params(Params::Create(*args_));
535 EXTENSION_FUNCTION_VALIDATE(params); 546 EXTENSION_FUNCTION_VALIDATE(params);
536 547
537 using file_manager::VolumeManager; 548 using file_manager::VolumeManager;
538 using file_manager::Volume; 549 using file_manager::Volume;
539 VolumeManager* const volume_manager = 550 VolumeManager* const volume_manager =
540 VolumeManager::Get(chrome_details_.GetProfile()); 551 VolumeManager::Get(chrome_details_.GetProfile());
541 LOG(ERROR) << "LOOKING FOR: " << params->volume_id;
542 base::WeakPtr<Volume> volume = 552 base::WeakPtr<Volume> volume =
543 volume_manager->FindVolumeById(params->volume_id); 553 volume_manager->FindVolumeById(params->volume_id);
544 if (!volume.get()) 554 if (!volume.get())
545 return RespondNow(Error("Volume not found.")); 555 return RespondNow(Error("Volume not found."));
546 556
547 using chromeos::file_system_provider::Service; 557 using chromeos::file_system_provider::Service;
548 Service* const service = Service::Get(chrome_details_.GetProfile()); 558 Service* const service = Service::Get(chrome_details_.GetProfile());
549 DCHECK(service); 559 DCHECK(service);
550 560
551 using chromeos::file_system_provider::ProvidedFileSystemInterface; 561 using chromeos::file_system_provider::ProvidedFileSystemInterface;
(...skipping 12 matching lines...) Expand all
564 base::File::Error result) { 574 base::File::Error result) {
565 if (result != base::File::FILE_OK) { 575 if (result != base::File::FILE_OK) {
566 Respond(Error("Failed to complete configuration.")); 576 Respond(Error("Failed to complete configuration."));
567 return; 577 return;
568 } 578 }
569 579
570 Respond(NoArguments()); 580 Respond(NoArguments());
571 } 581 }
572 582
573 } // namespace extensions 583 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698