blob: 04e9bc761f878ac1e97210e56a73c428fc673e8c [file] [log] [blame]
// Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
'use strict';
/**
* Root class of the background page.
* @param {boolean} fullscreen Whether the window is fullscreen or not.
* @constructor
*/
function Background(fullscreen) {
/**
* Flag to use fullscreen or not.
* @type {boolean}
* @private
*/
this.fullscreen_ = fullscreen;
Object.freeze(this);
chrome.app.runtime.onLaunched.addListener(this.onLaunched_.bind(this));
}
/**
* Handles launched events.
* @private
*/
Background.prototype.onLaunched_ = function() {
chrome.app.window.create(
'screen.html',
{
bounds: {width: 800, height: 600},
state: this.fullscreen_ ? 'fullscreen' : 'normal'
});
};
var background = new Background(true);