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

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

Issue 10803037: [WIP] ash/extensions: Add experimental extension support for window-management in ash. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge-152100 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/api/api.gyp ('k') | chrome/common/extensions/permissions/api_permission.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/api/experimental_wm.idl
diff --git a/chrome/common/extensions/api/experimental_wm.idl b/chrome/common/extensions/api/experimental_wm.idl
new file mode 100644
index 0000000000000000000000000000000000000000..f9235a50ea61aca540a170839fbf6d28fb5309df
--- /dev/null
+++ b/chrome/common/extensions/api/experimental_wm.idl
@@ -0,0 +1,158 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Window management API for Ash/Chrome OS.
+
+namespace experimental.wm {
+ enum WindowType {
+ modal,
+ normal,
+ panel
+ };
+
+ enum WindowListOrder {
+ creation,
+ activity
+ };
+
+ enum WindowState {
+ normal,
+ minimized,
+ maximized,
+ fullscreen
+ };
+
+ enum EventModifier {
+ shift,
+ control,
+ alt
+ };
+
+ enum Event {
+ mousepress,
+ mouserelease,
+ mousemove,
+ mousedrag,
+
+ keypress,
+ keyrelease,
+
+ gesturetapdown,
+ gesturetap,
+ gesturescrollstart,
+ gesturescrollend,
+ gesturescrollupdate,
+ gesturefling,
+ gesturepinchstart,
+ gesturepinchend,
+ gesturepinchupdate
+ };
+
+ // The position and size of windows in screen coordinates.
+ dictionary Bounds {
+ long x;
+ long y;
+ long width;
+ long height;
+ };
+
+ dictionary AshWindow {
+ // A unique identifier for the window during the lifetime of the session.
+ long id;
+
+ // Window type and state.
+ WindowType type;
+ WindowState state;
+
+ // The user-visible title of the window. This can be empty.
+ DOMString title;
+
+ // The name of the window. This is an internal name, i.e. invisible to the
+ // user, and usually represents the class of the window (e.g. all browser
+ // windows will usually have the same name).
+ DOMString name;
+
+ Bounds bounds;
+
+ // At most one window can be active at a time.
+ boolean active;
+ };
+
+ dictionary TransformDetails {
+ double? scale;
+
+ double? translateX;
+ double? translateY;
+
+ double? perspective;
+
+ double? rotate;
+ };
+
+ callback AllWindowsCallback = void (AshWindow[] windows);
+ callback ScreenBoundsCallback = void (Bounds bounds);
+ callback EventCallback = void (AshWindow window);
+
+ interface Functions {
+ // Closes the window. If the window has child windows, then those windows
+ // are closed too.
+ static void close(long window_id);
+
+ // Changes the state of the window to minimized, maximized, fullscreen, or
+ // restores the window to its original bounds.
+ static void minimize(long window_id);
+ static void maximize(long window_id);
+ static void fullscreen(long window_id);
+ static void restore(long window_id);
+
+ // Changes the opacity, transform or bounds of the windows. The change can
+ // optionally be animated over the predefined duration, or set immediately.
+ static void opacity(long window_id,
+ double opacity,
+ optional long durationInMilliSeconds);
+
+ static void transform(long window_id,
+ TransformDetails transform,
+ optional long durationInMilliSeconds);
+
+ static void setWindowBounds(long window_id,
+ Bounds bounds,
+ optional long durationInMilliSeconds);
+
+ // Gets a list of all the windows. The list is in MRU order of |order| is
+ // set to 'activity', otherwise the list is sorted based on their creation
+ // time.
+ static void windows(optional WindowListOrder order,
+ AllWindowsCallback callback);
+
+ // Gets the size of the screen. Currently this will work predictably for a
+ // single monitor.
+ // TODO(sad): Make this multi-monitor aware.
+ static void screenBounds(ScreenBoundsCallback callback);
+
+ // Stack one window above another.
+ static void stackWindowAbove(long above_window_id,
+ long below_window_id);
+
+ };
+
+ interface Events {
+ // This is triggered immediately after a window is created, but before it is
+ // displayed.
+ static void onWindowCreated(AshWindow window);
+
+ // This is triggered whenever the window is closed (i.e. by the user, by
+ // the web-page, or by the WM app from the close API call).
+ static void onWindowClosed(AshWindow window);
+
+ // This is triggered when a window is hidden.
+ static void onWindowHidden(AshWindow window);
+
+ // This is triggered when a window is made visible.
+ static void onWindowShown(AshWindow window);
+
+ // This is triggered when a new window becomes active.
+ static void onActiveWindowChanged(AshWindow window);
+ };
+};
« no previous file with comments | « chrome/common/extensions/api/api.gyp ('k') | chrome/common/extensions/permissions/api_permission.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698