- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / test / data / extensions / platform_apps / event_page / suspend_storage_api / main.js
1 // Copyright 2013 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 chrome.app.runtime.onLaunched.addListener(function() {
6
7   var screenWidth = screen.availWidth;
8   var screenHeight = screen.availHeight;
9   var width = 500;
10   var height = 300;
11
12   chrome.app.window.create('index.html', {
13     bounds: {
14       width: width,
15       height: height,
16       left: Math.round((screenWidth-width)/2),
17       top: Math.round((screenHeight-height)/2)
18     }
19   });
20 });
21
22 chrome.runtime.onSuspend.addListener(function() {
23   var now = new Date();
24   chrome.storage.local.set({"last_save": now.toLocaleString()}, function() {
25     console.log("Finished writing last_save: " + now.toLocaleString());
26   });
27 });