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

Side by Side Diff: ui/file_manager/gallery/js/background.js

Issue 246543002: Add script files of the separated Gallery.app. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 6 years, 7 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 | « ui/file_manager/gallery/gallery.html ('k') | ui/file_manager/gallery/js/gallery.js » ('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 2014 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 'use strict';
6
7 var stringData = new Promise(function(fulfill) {
8 chrome.fileBrowserPrivate.getStrings(function(stringData) {
9 loadTimeData.data = stringData;
10 fulfill(stringData);
11 });
12 });
13
14 // VolumeManager should be obtained after stringData initialized.
15 var volumeManager = stringData.then(function() {
16 return new Promise(function(fulfill) {
17 VolumeManager.getInstance(fulfill);
18 });
19 });
20
21 var backgroundComponent = Promise.all([stringData, volumeManager]).
22 then(function(args) {
23 return {
24 stringData: args[0],
25 volumeManager: args[1]
26 };
27 });
28
29 chrome.app.runtime.onLaunched.addListener(function(launchData) {
30 // Skip if files are not selected.
31 if (!launchData || !launchData.items || launchData.items.length == 0)
32 return;
33
34 // Open application window.
35 chrome.app.window.create(
36 'gallery.html',
37 {
38 id: 'video',
39 minWidth: 160,
40 minHeight: 100,
41 frame: 'none'
42 },
43 function(appWindow) {
44 appWindow.contentWindow.launchData = launchData;
45 appWindow.contentWindow.backgroundComponent = backgroundComponent;
46 });
47 });
OLDNEW
« no previous file with comments | « ui/file_manager/gallery/gallery.html ('k') | ui/file_manager/gallery/js/gallery.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698