Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Unified Diff: chrome/renderer/resources/extensions/app_window_custom_bindings.js

Issue 10878040: Move context-sensitive app.window.* functions to app.window.current().* (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/permissions/api_permission.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
})
});
« no previous file with comments | « chrome/common/extensions/permissions/api_permission.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698