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

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

Issue 11193049: Add the app.windows.getBounds method (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased against head Created 8 years, 1 month 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/api/app_window.idl ('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 b1ed42f3edbcc392a8021db8aebc02c6c3c0f811..d087c72f15889772107555e42e18222e662907dd 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 };
+ };
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;
+};
« no previous file with comments | « chrome/common/extensions/api/app_window.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698