2013-09-05 01:36:27 +00:00
|
|
|
var mainWindow = null;
|
|
|
|
|
2013-08-20 00:53:03 +00:00
|
|
|
chrome.app.runtime.onLaunched.addListener(function(launchData) {
|
2013-09-05 01:36:27 +00:00
|
|
|
|
|
|
|
if (mainWindow) {
|
|
|
|
mainWindow.contentWindow.launchData = launchData;
|
|
|
|
mainWindow.contentWindow.require(["command"], function(c) {
|
|
|
|
c.fire("session:open-launch");
|
|
|
|
});
|
2013-09-12 02:36:14 +00:00
|
|
|
mainWindow.focus();
|
|
|
|
mainWindow.drawAttention();
|
2013-09-05 01:36:27 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
//launchData.items will contain files from file manager
|
|
|
|
chrome.storage.local.get("bounds", function(data) {
|
|
|
|
var bounds = data.bounds || {
|
|
|
|
width: 800,
|
|
|
|
height: 600,
|
2013-09-13 18:13:00 +00:00
|
|
|
left: 50,
|
|
|
|
top: 50
|
2013-09-05 01:36:27 +00:00
|
|
|
};
|
|
|
|
chrome.app.window.create("main.html", {
|
|
|
|
bounds: bounds
|
|
|
|
}, function(win) {
|
|
|
|
mainWindow = win;
|
|
|
|
win.contentWindow.launchData = launchData;
|
|
|
|
mainWindow.onClosed.addListener(function() {
|
|
|
|
mainWindow = null;
|
2013-08-23 23:03:46 +00:00
|
|
|
});
|
2013-08-20 00:53:03 +00:00
|
|
|
});
|
2013-09-05 01:36:27 +00:00
|
|
|
|
|
|
|
});
|
|
|
|
|
2013-08-20 00:53:03 +00:00
|
|
|
});
|