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..7bf1128ffda0dc7041c1db4cc95c1bd0703643ee 100644 |
| --- a/chrome/renderer/resources/extensions/app_window_custom_bindings.js |
| +++ b/chrome/renderer/resources/extensions/app_window_custom_bindings.js |
| @@ -16,14 +16,19 @@ 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) { |
|
not at google - send to devlin
2012/08/27 01:51:59
loops with "foo in bar" should be protected by has
jeremya
2012/08/30 02:38:54
Done.
|
| + AppWindow.prototype[fn] = |
| + chromeHidden.internalAPIs.app.currentWindowInternal[fn]; |
| + } |
| + AppWindow.prototype.moveTo = window.moveTo.bind(window); |
| + AppWindow.prototype.resizeTo = window.resizeTo.bind(window); |
| + AppWindow.prototype.__defineGetter__('dom', function () { return window; }); |
|
not at google - send to devlin
2012/08/27 01:51:59
what's the advantage of making this a getter over
jeremya
2012/08/30 02:38:54
... don't know :) changed to a property.
|
| + apiFunctions.setHandleRequest('current', function() { |
| + return new AppWindow; |
| }) |
| }); |