From c0b249ae797a971638df4a38f8bf60aa9152bcd8 Mon Sep 17 00:00:00 2001 From: Jonathan Pevarnek Date: Mon, 20 Apr 2015 18:03:24 -0400 Subject: [PATCH] Add missing functions for chrome windows api --- chrome/chrome-app-tests.ts | 7 ++++++- chrome/chrome-app.d.ts | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/chrome/chrome-app-tests.ts b/chrome/chrome-app-tests.ts index 01657dc85..de56bbac8 100644 --- a/chrome/chrome-app-tests.ts +++ b/chrome/chrome-app-tests.ts @@ -23,8 +23,13 @@ chrome.app.runtime.onLaunched.addListener(function (launchData: runtime.LaunchDa chrome.app.runtime.onRestarted.addListener(function () { return; }); -// Get Current Window +// retrieving windows 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(); + +// check platform capabilities +var visibleEverywhere: boolean = chrome.app.window.canSetVisibleOnAllWorkspaces(); // FileSystem // https://developer.chrome.com/apps/fileSystem diff --git a/chrome/chrome-app.d.ts b/chrome/chrome-app.d.ts index a2b0d5997..2f498ed28 100644 --- a/chrome/chrome-app.d.ts +++ b/chrome/chrome-app.d.ts @@ -126,6 +126,9 @@ declare module chrome.app.window { export function create(url: string, options?: CreateWindowOptions, callback?: (created_window: AppWindow) => void): void; export function current(): AppWindow; + export function get(id: string): AppWindow; + export function getAll(): AppWindow[]; + export function canSetVisibleOnAllWorkspaces(): boolean; interface WindowEvent { addListener(callback: () => void): void;