1 // Copyright (c) 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 /** 6 * Gets info about the current window. 7 * 8 * @param {function(*)} callback The callback to invoke with the window info. 9 */ 10 function getWindowInfo(callback) { 11 chrome.windows.getCurrent({populate: true}, callback); 12 } 13 14 /** 15 * Updates the properties of the current window. 16 * 17 * @param {Object} updateInfo Update info to pass to chrome.windows.update. 18 * @param {function()} callback Invoked when the updating is complete. 19 */ 20 function updateWindow(updateInfo, callback) { 21 chrome.windows.getCurrent({}, function(window) { 22 chrome.windows.update(window.id, updateInfo, callback); 23 }); 24 } 25