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

Unified Diff: apps/shell/common/api/shell.idl

Issue 254473011: Introduce chrome.shell.createWindow stub API for app_shell (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase (shell-api) Created 6 years, 8 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
Index: apps/shell/common/api/shell.idl
diff --git a/apps/shell/common/api/shell.idl b/apps/shell/common/api/shell.idl
new file mode 100644
index 0000000000000000000000000000000000000000..08f22bb2d14dea4a0423c3cb735aec98d8e0b084
--- /dev/null
+++ b/apps/shell/common/api/shell.idl
@@ -0,0 +1,50 @@
+// Copyright 2014 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.
+
+// Use the <code>chrome.shell</code> API to watch for launch events and create
James Cook 2014/04/28 21:04:19 I'm also planning to add an onLaunched event to th
+// windows. The createWindow API is a subset of
Yoyo Zhou 2014/04/29 22:10:00 <code>createWindow</code>
James Cook 2014/04/29 22:53:52 Done.
+// <code>chrome.app.window.create</code>.
+namespace shell {
+
+ [noinline_doc] dictionary CreateWindowOptions {
+ // Stub for the id of a window. This parameter is ignored in app_shell but
+ // provided for compatibility with apps running in Chrome.
+ DOMString? id;
+
+ // Stubs for the bounds of a window. These parameters are ignored in
+ // app_shell but are provided for compatibility with apps running in Chrome.
Yoyo Zhou 2014/04/29 22:10:00 nit: change this . to a semicolon.
James Cook 2014/04/29 22:53:52 Done.
+ // The created window will always fill the root window of the default
+ // display.
+ object? innerBounds;
+ object? outerBounds;
+ };
+
+ // Called in the creating window (parent) before the load event is called in
+ // the created window (child). The parent can set fields or functions on the
+ // child usable from onload. E.g. background.js:<br>
+ // <code>function(createdWindow) { createdWindow.contentWindow.foo =
+ // function () { }; };</code>
+ // <br>window.js:<br>
+ // <code>window.onload = function () { foo(); }</code>
+ callback CreateWindowCallback =
+ void ([instanceOf=AppWindow] object createdWindow);
+
+ [noinline_doc] dictionary AppWindow {
+ // The JavaScript 'window' object for the created child.
+ [instanceOf=Window] object contentWindow;
+ };
+
+ interface Functions {
+ // Creates a fullscreen window on the default display. Options for id and
+ // bounds are ignored.
+ static void createWindow(DOMString url,
+ optional CreateWindowOptions options,
+ optional CreateWindowCallback callback);
+
+ // Returns an $(ref:AppWindow) object for the current script context
+ // (i.e. JavaScript 'window' object).
+ [nocompile] static AppWindow currentWindow();
+ [nocompile, nodoc] static void initializeAppWindow();
+ };
+};

Powered by Google App Engine
This is Rietveld 408576698