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

Side by Side Diff: chrome/renderer/resources/extensions/app_runtime_custom_bindings.js

Issue 10869067: Deliver attach intent to packaged apps (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Allowed file contents to actually be read Created 8 years, 3 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Custom bindings for the chrome.app.runtime API. 5 // Custom bindings for the chrome.app.runtime API.
6 6
7 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden(); 7 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden();
8 var fileSystemHelpers = requireNative('file_system_natives'); 8 var fileSystemHelpers = requireNative('file_system_natives');
9 var GetIsolatedFileSystem = fileSystemHelpers.GetIsolatedFileSystem; 9 var GetIsolatedFileSystem = fileSystemHelpers.GetIsolatedFileSystem;
10 var appNatives = requireNative('app_runtime'); 10 var appNatives = requireNative('app_runtime');
(...skipping 17 matching lines...) Expand all
28 dispatch([launchData]); 28 dispatch([launchData]);
29 }, function(fileError) { 29 }, function(fileError) {
30 console.error('Error getting fileEntry, code: ' + fileError.code); 30 console.error('Error getting fileEntry, code: ' + fileError.code);
31 dispatch([]); 31 dispatch([]);
32 }); 32 });
33 } catch (e) { 33 } catch (e) {
34 console.error('Error in event handler for onLaunched: ' + e.stack); 34 console.error('Error in event handler for onLaunched: ' + e.stack);
35 dispatch([]); 35 dispatch([]);
36 } 36 }
37 break; 37 break;
38 case('filesystem'):
39 launchData.intent.data = GetIsolatedFileSystem(intentData.fileSystemId,
40 intentData.baseName);
41 launchData.intent.postResult = function() {};
42 launchData.intent.postFailure = function() {};
43 dispatch([launchData]);
44 break;
38 case('serialized'): 45 case('serialized'):
39 var deserializedData = DeserializeString(intentData.data); 46 var deserializedData = DeserializeString(intentData.data);
40 launchData.intent.data = deserializedData; 47 launchData.intent.data = deserializedData;
41 launchData.intent.postResult = function() {}; 48 launchData.intent.postResult = function() {};
42 launchData.intent.postFailure = function() {}; 49 launchData.intent.postFailure = function() {};
43 dispatch([launchData]); 50 dispatch([launchData]);
44 break; 51 break;
45 case('blob'): 52 case('blob'):
46 var blobData = CreateBlob(intentData.blobFilePath, 53 var blobData = CreateBlob(intentData.blobFilePath,
47 intentData.blobLength); 54 intentData.blobLength);
48 launchData.intent.data = blobData; 55 launchData.intent.data = blobData;
49 launchData.intent.postResult = function() {}; 56 launchData.intent.postResult = function() {};
50 launchData.intent.postFailure = function() {}; 57 launchData.intent.postFailure = function() {};
51 dispatch([launchData]); 58 dispatch([launchData]);
52 break; 59 break;
53 default: 60 default:
54 console.error('Unexpected launch data format'); 61 console.error('Unexpected launch data format');
55 dispatch([]); 62 dispatch([]);
56 } 63 }
57 } else if (launchData) { 64 } else if (launchData) {
58 dispatch([launchData]); 65 dispatch([launchData]);
59 } else { 66 } else {
60 dispatch([]); 67 dispatch([]);
61 } 68 }
62 }); 69 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698