Merge pull request #4384 from alexanderby/master

Added missing AppWindow events
This commit is contained in:
Horiuchi_H
2015-05-19 16:26:25 +09:00
2 changed files with 14 additions and 0 deletions

View File

@@ -28,6 +28,14 @@ var currentWindow: cwindow.AppWindow = chrome.app.window.current();
var otherWindow: cwindow.AppWindow = chrome.app.window.get('some-string');
var allWindows: cwindow.AppWindow[] = chrome.app.window.getAll();
// listening to window events
currentWindow.onBoundsChanged.addListener(function () { return; });
currentWindow.onClosed.addListener(function () { return; });
currentWindow.onFullscreened.addListener(function () { return; });
currentWindow.onMaximized.addListener(function () { return; });
currentWindow.onMinimized.addListener(function () { return; });
currentWindow.onRestored.addListener(function () { return; });
// check platform capabilities
var visibleEverywhere: boolean = chrome.app.window.canSetVisibleOnAllWorkspaces();

View File

@@ -122,6 +122,12 @@ declare module chrome.app.window {
id: string;
innerBounds: Bounds;
outerBounds: Bounds;
onBoundsChanged: WindowEvent;
onClosed: WindowEvent;
onFullscreened: WindowEvent;
onMaximized: WindowEvent;
onMinimized: WindowEvent;
onRestored: WindowEvent;
}
export function create(url: string, options?: CreateWindowOptions, callback?: (created_window: AppWindow) => void): void;