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 ed430be286df5698911eb2394a619b402ff1515a..8534d1cf4f119d741b73a5ac97c0335ccef91db9 100644 |
| --- a/chrome/renderer/resources/extensions/app_window_custom_bindings.js |
| +++ b/chrome/renderer/resources/extensions/app_window_custom_bindings.js |
| @@ -16,14 +16,18 @@ chromeHidden.registerCustomHook('app.window', function(bindingsAPI) { |
| if (viewId) |
| view = GetView(viewId); |
| if (request.callback) { |
| - request.callback(view); |
| + request.callback(view.chrome.app.window.current()); |
| delete request.callback; |
| } |
| }) |
| - apiFunctions.setHandleRequest('moveTo', function(x, y) { |
| - window.moveTo(x, y); |
| - }) |
| - apiFunctions.setHandleRequest('resizeTo', function(width, height) { |
| - window.resizeTo(width, height); |
| + var AppWindow = function() {}; |
| + for (var fn in chromeHidden.internalAPIs.app.currentWindowInternal) { |
| + AppWindow.prototype[fn] = |
| + chromeHidden.internalAPIs.app.currentWindowInternal[fn]; |
| + } |
| + AppWindow.prototype.moveTo = window.moveTo.bind(window); |
|
Mihai Parparita -not on Chrome
2012/08/24 17:58:09
Will this do the right thing for manipulating non-
jeremya
2012/08/26 23:49:38
appWindow in the callback there is the return valu
|
| + AppWindow.prototype.resizeTo = window.resizeTo.bind(window); |
| + apiFunctions.setHandleRequest('current', function() { |
| + return new AppWindow; |
| }) |
| }); |