Skip to content

Commit

Permalink
[Extensions + Apps] Move the mediaGalleries API
Browse files Browse the repository at this point in the history
Move the mediaGalleries API out of extensions code and into apps
code. This includes the API implementation, schema definition, features
entries, and API permission info.

Bug: 877240

Change-Id: I8b750143cdcd36700f36d9da088ebaec4abd4cfe
Reviewed-on: https://chromium-review.googlesource.com/1255584
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Reviewed-by: Tommy Li <tommycli@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595866}
  • Loading branch information
rdcronin authored and Commit Bot committed Oct 2, 2018
1 parent 3401067 commit d128279
Show file tree
Hide file tree
Showing 22 changed files with 237 additions and 243 deletions.
14 changes: 13 additions & 1 deletion chrome/browser/apps/platform_apps/api/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,28 @@ source_set("api") {
"browser/browser_api.h",
"browser_context_keyed_service_factories.cc",
"browser_context_keyed_service_factories.h",
"media_galleries/blob_data_source_factory.cc",
"media_galleries/blob_data_source_factory.h",
"media_galleries/media_galleries_api.cc",
"media_galleries/media_galleries_api.h",
"media_galleries/media_galleries_api_util.cc",
"media_galleries/media_galleries_api_util.h",
]

deps = [
"//chrome/app:generated_resources_grit",

# TODO(https://crbug.com/883570): It'd be nice to have more APIs here
# extracted into their own BUILD files (so they are easy to audit, add, or
# remove), but any that depend on //chrome/browser:browser can't.
"//chrome/browser/apps/platform_apps/api/music_manager_private",
"//chrome/browser/extensions",
"//chrome/browser/ui",
"//chrome/common",
"//chrome/common/apps/platform_apps/api",
"//chrome/services/media_gallery_util/public/cpp",
"//components/storage_monitor",
"//components/web_modal",
"//extensions/browser",
]

Expand All @@ -52,7 +65,6 @@ source_set("api") {
deps += [
"//chrome:strings",
"//chrome/browser/chromeos",
"//chrome/browser/ui",
"//chromeos/components/proximity_auth",
"//chromeos/components/proximity_auth/logging",
"//components/account_id",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/extensions/api/media_galleries/blob_data_source_factory.h"
#include "chrome/browser/apps/platform_apps/api/media_galleries/blob_data_source_factory.h"
#include "content/public/browser/browser_context.h"
#include "extensions/browser/blob_reader.h"
#include "mojo/public/cpp/bindings/binding.h"

namespace extensions {
namespace chrome_apps {
namespace api {
namespace {

// Media data source that reads data from a blob in browser process.
Expand Down Expand Up @@ -80,4 +81,5 @@ BlobDataSourceFactory::CreateMediaDataSource(
blob_uuid_, media_data_callback);
}

} // namespace extensions
} // namespace api
} // namespace chrome_apps
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_EXTENSIONS_API_MEDIA_GALLERIES_BLOB_DATA_SOURCE_FACTORY_H_
#define CHROME_BROWSER_EXTENSIONS_API_MEDIA_GALLERIES_BLOB_DATA_SOURCE_FACTORY_H_
#ifndef CHROME_BROWSER_APPS_PLATFORM_APPS_API_MEDIA_GALLERIES_BLOB_DATA_SOURCE_FACTORY_H_
#define CHROME_BROWSER_APPS_PLATFORM_APPS_API_MEDIA_GALLERIES_BLOB_DATA_SOURCE_FACTORY_H_

#include <memory>
#include <string>
Expand All @@ -16,7 +16,8 @@ namespace content {
class BrowserContext;
} // namespace content

namespace extensions {
namespace chrome_apps {
namespace api {

// Factory to provide media data source for extension media gallery API.
// Internally it will read media data from a blob in browser process.
Expand All @@ -40,6 +41,7 @@ class BlobDataSourceFactory
DISALLOW_COPY_AND_ASSIGN(BlobDataSourceFactory);
};

} // namespace extensions
} // namespace api
} // namespace chrome_apps

#endif // CHROME_BROWSER_EXTENSIONS_API_MEDIA_GALLERIES_BLOB_DATA_SOURCE_FACTORY_H_
#endif // CHROME_BROWSER_APPS_PLATFORM_APPS_API_MEDIA_GALLERIES_BLOB_DATA_SOURCE_FACTORY_H_
Loading

0 comments on commit d128279

Please sign in to comment.