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

Unified Diff: chrome/common/extensions/api/app_window.idl

Issue 11369039: Add setBounds method and browsertest for get/set bounds to app window API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
Index: chrome/common/extensions/api/app_window.idl
diff --git a/chrome/common/extensions/api/app_window.idl b/chrome/common/extensions/api/app_window.idl
index dd576d5eb0b1a11f779ccffa1122a1d802ca5fd1..06fa69d8574e07db42f99a4cdd7685f8f2e9782c 100644
--- a/chrome/common/extensions/api/app_window.idl
+++ b/chrome/common/extensions/api/app_window.idl
@@ -59,6 +59,13 @@ namespace app.window {
callback CreateWindowCallback =
void ([instanceOf=AppWindow] object created_window);
+ dictionary Bounds {
+ long? left;
+ long? top;
+ long? width;
+ long? height;
+ };
+
dictionary AppWindow {
// Focus the window.
static void focus();
@@ -72,8 +79,8 @@ namespace app.window {
// Restore the window.
static void restore();
- // Move the window to the position (|x|, |y|).
- static void moveTo(long x, long y);
+ // Move the window to the position (|left|, |top|).
+ static void moveTo(long left, long top);
// Resize the window to |width|x|height| pixels in size.
static void resizeTo(long width, long height);
@@ -93,6 +100,9 @@ namespace app.window {
// Hide the window. Does nothing if the window is already hidden.
static void hide();
+ // Set the window's bounds.
+ static void setBounds(Bounds bounds);
+
// The JavaScript 'window' object for the created child.
[instanceOf=global] object contentWindow;
};
@@ -127,6 +137,10 @@ namespace app.window {
optional CreateWindowOptions options,
optional CreateWindowCallback callback);
+ // Returns an <a href="#type-AppWindow">AppWindow</a> object for the
+ // current script context (ie JavaScript 'window' object). This can also be
+ // called on a handle to a script context for another page, for example:
+ // otherWindow.chrome.app.window.current().
[nocompile] static AppWindow current();
[nocompile, nodoc] static void initializeAppWindow(object state);
};

Powered by Google App Engine
This is Rietveld 408576698