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

Unified Diff: chrome/renderer/resources/extensions/experimental.media_galleries_custom_bindings.js

Issue 10823193: Move MediaGalleries.getMediaFileSystems back to experimental for M22 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/resources/extensions/experimental.media_galleries_custom_bindings.js
diff --git a/chrome/renderer/resources/extensions/experimental.media_galleries_custom_bindings.js b/chrome/renderer/resources/extensions/experimental.media_galleries_custom_bindings.js
index 07b33d46065e1db756477000b15b36c8fddff232..e945a773d009c4d93399f5c11021a75b98bd64b0 100644
--- a/chrome/renderer/resources/extensions/experimental.media_galleries_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/experimental.media_galleries_custom_bindings.js
@@ -4,7 +4,7 @@
// Custom bindings for the Media Gallery API.
-var mediaGalleriesNatives = requireNative('mediaGalleries');
+var mediaGalleriesNatives = requireNative('experimental_mediaGalleries');
var chromeHidden = requireNative('chrome_hidden').GetChromeHidden();
@@ -12,6 +12,23 @@ chromeHidden.registerCustomHook('experimental.mediaGalleries',
function(bindingsAPI, extensionId) {
var apiFunctions = bindingsAPI.apiFunctions;
+ // getMediaFileSystems uses a custom callback so that it can instantiate and
+ // return an array of file system objects.
+ apiFunctions.setCustomCallback('getMediaFileSystems',
+ function(name, request, response) {
+ var result = null;
+ if (response) {
+ result = [];
+ for (var i = 0; i < response.length; i++) {
+ result.push(mediaGalleriesNatives.GetMediaFileSystemObject(
+ response[i].fsid, response[i].name));
+ }
+ }
+ if (request.callback)
+ request.callback(result);
+ request.callback = null;
+ });
+
// extractEmbeddedThumbnails uses a renderer side handler so that it can
// synchronously return a result. The result object's state is computable
// from the function's input.
« no previous file with comments | « chrome/renderer/renderer_resources.grd ('k') | chrome/renderer/resources/extensions/media_galleries_custom_bindings.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698