From b0d1fa0b584ebdd8fa1f2455931565c4c4b1ba94 Mon Sep 17 00:00:00 2001 From: Alexander Shutov Date: Wed, 13 May 2015 16:46:45 +0300 Subject: [PATCH] Added missing AppWindow events. --- chrome/chrome-app-tests.ts | 8 ++++++++ chrome/chrome-app.d.ts | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/chrome/chrome-app-tests.ts b/chrome/chrome-app-tests.ts index de56bbac89..970e03517b 100644 --- a/chrome/chrome-app-tests.ts +++ b/chrome/chrome-app-tests.ts @@ -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(); diff --git a/chrome/chrome-app.d.ts b/chrome/chrome-app.d.ts index 2f498ed28c..5cfa0fbce4 100644 --- a/chrome/chrome-app.d.ts +++ b/chrome/chrome-app.d.ts @@ -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;