Chromium Code Reviews| Index: chrome/renderer/resources/extensions/app_window_custom_bindings.js |
| diff --git a/chrome/renderer/resources/extensions/app_window_custom_bindings.js b/chrome/renderer/resources/extensions/app_window_custom_bindings.js |
| index b1ed42f3edbcc392a8021db8aebc02c6c3c0f811..117e0e50a3cf7f9c7e6cb5c69dbcef6a1eac0858 100644 |
| --- a/chrome/renderer/resources/extensions/app_window_custom_bindings.js |
| +++ b/chrome/renderer/resources/extensions/app_window_custom_bindings.js |
| @@ -83,14 +83,30 @@ chromeHidden.registerCustomHook('app.window', function(bindingsAPI) { |
| AppWindow.prototype.close = function() { |
| this.contentWindow.close(); |
| }; |
| + AppWindow.prototype.getBounds = function() { |
| + var bounds = chromeHidden.appWindowData.bounds; |
| + return { left: bounds.left, top: bounds.top, |
| + width: bounds.width, height:bounds.height }; |
|
jeremya
2012/10/31 00:32:46
nit: missing space
asargent_no_longer_on_chrome
2012/10/31 05:37:35
Done.
|
| + }; |
| Object.defineProperty(AppWindow.prototype, 'id', {get: function() { |
| return chromeHidden.appWindowData.id; |
| }}); |
| chromeHidden.appWindowData = { |
| - id: params.id || '' |
| + id: params.id || '', |
| + bounds: { left: 0, top: 0, width: 0, height: 0 } |
| }; |
| chromeHidden.currentAppWindow = new AppWindow; |
| }); |
| }); |
| + |
| +chromeHidden.updateAppWindowBounds = function(info) { |
| + var data = chromeHidden.appWindowData; |
| + if (!data) |
| + return; |
| + data.bounds.left = info.left; |
| + data.bounds.top = info.top; |
| + data.bounds.width = info.width; |
| + data.bounds.height = info.height; |
| +}; |