Backed out changeset 1864e27d5ee4 (bug 920481)

This commit is contained in:
Ed Morley 2013-10-23 16:14:35 +01:00
parent 7ffd053b7a
commit 3aedc370e8
2 changed files with 10 additions and 41 deletions

View File

@ -14,7 +14,7 @@ const {AppProjects} = require("devtools/app-manager/app-projects");
const {AppValidator} = require("devtools/app-manager/app-validator");
const {Services} = Cu.import("resource://gre/modules/Services.jsm");
const {FileUtils} = Cu.import("resource://gre/modules/FileUtils.jsm");
const {installHosted, installPackaged, getTargetForApp, reloadApp} = require("devtools/app-actor-front");
const {installHosted, installPackaged, getTargetForApp} = require("devtools/app-actor-front");
const {EventEmitter} = Cu.import("resource:///modules/devtools/shared/event-emitter.js");
const promise = require("sdk/core/promise");
@ -174,26 +174,16 @@ let UI = {
return this.install(project);
}
})
.then(() => {
.then(
() => {
button.disabled = false;
// Finally try to reload the app if it is already opened
this.reload(project);
},
(res) => {
button.disabled = false;
let message = res.error + ": " + res.message;
alert(message);
this.connection.log(message);
});
},
reload: function (project) {
return reloadApp(this.connection.client,
this.listTabsResponse.webappsActor,
this._getProjectManifestURL(project)).
then(() => {
this.connection.log("App reloaded");
});
},
(res) => {
button.disabled = false;
let message = res.error + ": " + res.message;
alert(message);
this.connection.log(message);
});
},
remove: function(location, event) {

View File

@ -240,24 +240,3 @@ function getTargetForApp(client, webappsActor, manifestURL) {
}
exports.getTargetForApp = getTargetForApp;
function reloadApp(client, webappsActor, manifestURL) {
let deferred = promise.defer();
getTargetForApp(client,
webappsActor,
manifestURL).
then((target) => {
// Request the ContentAppActor to reload the app
let request = {
to: target.form.actor,
type: "reload",
manifestURL: manifestURL
};
client.request(request, (res) => {
deferred.resolve();
});
}, () => {
deferred.reject("Not running");
});
return deferred.promise;
}
exports.reloadApp = reloadApp;