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

Side by Side Diff: chrome/renderer/resources/extensions/experimental.media_galleries_custom_bindings.js

Issue 9621021: DO NOT COMMIT (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix rebase Created 8 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/renderer_resources.grd ('k') | webkit.patch » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Custom bindings for the Media Gallery API.
6
7 var mediaGalleriesNatives = requireNative('experimental_mediaGalleries');
8 var CreateMediaGalleryObject = mediaGalleriesNatives.CreateMediaGalleryObject;
9
10 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden();
11
12 chromeHidden.registerCustomHook('experimental.mediaGalleries',
13 function(bindingsAPI, extensionId) {
14 var apiFunctions = bindingsAPI.apiFunctions;
15
16 apiFunctions.setCustomCallback('getMediaGalleries',
17 function(name, request, response) {
18 var result = new Array();
19 var resp = response ? chromeHidden.JSON.parse(response) : [];
20 for (var i = 0; i < resp.length; i++) {
21 result.push(CreateMediaGalleryObject(resp[i].id, resp[i].name,
22 resp[i].flags));
23
24 }
25 if (request.callback)
26 request.callback(result);
27 request.callback = null;
28 });
29 });
OLDNEW
« no previous file with comments | « chrome/renderer/renderer_resources.grd ('k') | webkit.patch » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698