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

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

Issue 10332071: Pass command line arguments onto platform apps which provide the right intent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Windows tests fixed Created 8 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
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 experimental.app API.
6
7 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden();
8 var experimentalAppNatives = requireNative('experimental_app');
9 var GetIsolatedFileSystem = experimentalAppNatives.GetIsolatedFileSystem;
10
11 chromeHidden.registerCustomHook('experimental.app', function(bindingsAPI) {
12 chrome.experimental.app.onLaunched.dispatch =
13 function(launchData, fileSystemId, baseName) {
14 if (launchData) {
15 event = this;
16 fs = GetIsolatedFileSystem(fileSystemId);
17 try {
18 fs.root.getFile(baseName, {}, function(fileEntry) {
19 launchData.intent.data = fileEntry;
20 launchData.intent.postResult = function() {};
21 launchData.intent.postFailure = function() {};
22 chrome.Event.prototype.dispatch.call(event, launchData);
23 }, function(fileError) {
24 console.error('Error getting fileEntry, code: ' + fileError.code);
25 chrome.Event.prototype.dispatch.call(event);
26 });
27 } catch (e) {
28 console.error('Error in event handler for onLaunched: ' + e.stack);
29 chrome.Event.prototype.dispatch.call(event);
30 }
31 } else {
32 chrome.Event.prototype.dispatch.call(this);
33 }
34 };
35 });
OLDNEW
« no previous file with comments | « chrome/renderer/renderer_resources.grd ('k') | chrome/test/data/extensions/platform_apps/launch_file/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698