| Index: chrome/browser/extensions/api/media_galleries/media_galleries_api.cc
|
| diff --git a/chrome/browser/extensions/api/media_gallery/media_gallery_api.cc b/chrome/browser/extensions/api/media_galleries/media_galleries_api.cc
|
| similarity index 63%
|
| rename from chrome/browser/extensions/api/media_gallery/media_gallery_api.cc
|
| rename to chrome/browser/extensions/api/media_galleries/media_galleries_api.cc
|
| index 15698f6081fcc0582d9248ec50199fa61e7e28ee..6c27da3e80ef885f11b3059c18d24c61f6de633f 100644
|
| --- a/chrome/browser/extensions/api/media_gallery/media_gallery_api.cc
|
| +++ b/chrome/browser/extensions/api/media_galleries/media_galleries_api.cc
|
| @@ -4,7 +4,7 @@
|
|
|
| // Implements the Chrome Extensions Media Galleries API.
|
|
|
| -#include "chrome/browser/extensions/api/media_gallery/media_gallery_api.h"
|
| +#include "chrome/browser/extensions/api/media_galleries/media_galleries_api.h"
|
|
|
| #include <string>
|
| #include <vector>
|
| @@ -12,6 +12,7 @@
|
| #include "base/platform_file.h"
|
| #include "base/values.h"
|
| #include "chrome/browser/media_gallery/media_file_system_registry.h"
|
| +#include "chrome/common/extensions/api/experimental_media_galleries.h"
|
| #include "content/public/browser/child_process_security_policy.h"
|
| #include "content/public/browser/render_process_host.h"
|
| #include "content/public/browser/render_view_host.h"
|
| @@ -22,12 +23,39 @@
|
|
|
| namespace extensions {
|
|
|
| +namespace {
|
| +
|
| +const char kInvalidInteractive[] = "Unknown value for interactive.";
|
| +
|
| +} // namespace
|
| +
|
| using chrome::MediaFileSystemRegistry;
|
| using content::ChildProcessSecurityPolicy;
|
|
|
| -GetMediaFileSystemsFunction::~GetMediaFileSystemsFunction() {}
|
| +namespace MediaGalleries = extensions::api::experimental_media_galleries;
|
| +namespace GetMediaFileSystems = MediaGalleries::GetMediaFileSystems;
|
| +
|
| +MediaGalleriesGetMediaFileSystemsFunction::
|
| + ~MediaGalleriesGetMediaFileSystemsFunction() {}
|
| +
|
| +bool MediaGalleriesGetMediaFileSystemsFunction::RunImpl() {
|
| + scoped_ptr<GetMediaFileSystems::Params> params(
|
| + GetMediaFileSystems::Params::Create(*args_));
|
| + EXTENSION_FUNCTION_VALIDATE(params.get());
|
| + MediaGalleries::GetMediaFileSystemsInteractivity interactive = "no";
|
| + if (params->details.get() && params->details->interactive.get())
|
| + interactive = *params->details->interactive;
|
| +
|
| + if (interactive == "yes") {
|
| + // TODO(estade): implement.
|
| + } else if (interactive == "if_needed") {
|
| + // TODO(estade): implement.
|
| + } else if (interactive != "no") {
|
| + error_ = kInvalidInteractive;
|
| + SetResult(false);
|
| + return true;
|
| + }
|
|
|
| -bool GetMediaFileSystemsFunction::RunImpl() {
|
| const content::RenderProcessHost* rph = render_view_host()->GetProcess();
|
| chrome::MediaFileSystemRegistry* media_fs_registry =
|
| MediaFileSystemRegistry::GetInstance();
|
| @@ -63,17 +91,10 @@ bool GetMediaFileSystemsFunction::RunImpl() {
|
| return true;
|
| }
|
|
|
| -OpenMediaGalleryManagerFunction::~OpenMediaGalleryManagerFunction() {}
|
| -
|
| -bool OpenMediaGalleryManagerFunction::RunImpl() {
|
| - // TODO(vandebo) Open the Media Gallery Manager UI.
|
| - SetResult(Value::CreateNullValue());
|
| - return true;
|
| -}
|
| -
|
| -AssembleMediaFileFunction::~AssembleMediaFileFunction() {}
|
| +MediaGalleriesAssembleMediaFileFunction::
|
| + ~MediaGalleriesAssembleMediaFileFunction() {}
|
|
|
| -bool AssembleMediaFileFunction::RunImpl() {
|
| +bool MediaGalleriesAssembleMediaFileFunction::RunImpl() {
|
| // TODO(vandebo) Update the metadata and return the new file.
|
| SetResult(Value::CreateNullValue());
|
| return true;
|
|
|