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

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

Issue 10834261: Move chrome.experimental.app.onLaunched event handler to chrome.app.runtime.onLaunched. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Another merge before retrying commit. 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.app_custom_bindings.js
diff --git a/chrome/renderer/resources/extensions/experimental.app_custom_bindings.js b/chrome/renderer/resources/extensions/experimental.app_custom_bindings.js
deleted file mode 100644
index a586df96f8e9e8eec8cb6c98678c7a71a9962894..0000000000000000000000000000000000000000
--- a/chrome/renderer/resources/extensions/experimental.app_custom_bindings.js
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Custom bindings for the experimental.app API.
-
-var chromeHidden = requireNative('chrome_hidden').GetChromeHidden();
-var fileSystemHelpers = requireNative('file_system_natives');
-var GetIsolatedFileSystem = fileSystemHelpers.GetIsolatedFileSystem;
-var appNatives = requireNative('experimental_app');
-var DeserializeString = appNatives.DeserializeString;
-var CreateBlob = appNatives.CreateBlob;
-
-chromeHidden.Event.registerArgumentMassager('experimental.app.onLaunched',
- function(args, dispatch) {
- var launchData = args[0];
- var intentData = args[1];
-
- if (launchData && intentData) {
- switch(intentData.format) {
- case('fileEntry'):
- var fs = GetIsolatedFileSystem(intentData.fileSystemId);
- try {
- fs.root.getFile(intentData.baseName, {}, function(fileEntry) {
- launchData.intent.data = fileEntry;
- launchData.intent.postResult = function() {};
- launchData.intent.postFailure = function() {};
- dispatch([launchData]);
- }, function(fileError) {
- console.error('Error getting fileEntry, code: ' + fileError.code);
- dispatch([]);
- });
- } catch (e) {
- console.error('Error in event handler for onLaunched: ' + e.stack);
- dispatch([]);
- }
- break;
- case('serialized'):
- var deserializedData = DeserializeString(intentData.data);
- launchData.intent.data = deserializedData;
- launchData.intent.postResult = function() {};
- launchData.intent.postFailure = function() {};
- dispatch([launchData]);
- break;
- case('blob'):
- var blobData = CreateBlob(intentData.blobFilePath,
- intentData.blobLength);
- launchData.intent.data = blobData;
- launchData.intent.postResult = function() {};
- launchData.intent.postFailure = function() {};
- dispatch([launchData]);
- break;
- default:
- console.error('Unexpected launch data format');
- dispatch([]);
- }
- } else if (launchData) {
- dispatch([launchData]);
- } else {
- dispatch([]);
- }
-});

Powered by Google App Engine
This is Rietveld 408576698