diff options
author | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-01 06:22:16 +0000 |
---|---|---|
committer | jamescook@chromium.org <jamescook@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-01 06:22:16 +0000 |
commit | 7d27834c659857c372786c7f865fbdf1550e88df (patch) | |
tree | 2443295a057131918823aedd5d33a8a38685073c /extensions/test/data | |
parent | 44eda8f2d61ea6c8785f3bd007dc644c26d543cd (diff) | |
download | chromium_src-7d27834c659857c372786c7f865fbdf1550e88df.zip chromium_src-7d27834c659857c372786c7f865fbdf1550e88df.tar.gz chromium_src-7d27834c659857c372786c7f865fbdf1550e88df.tar.bz2 |
Convert app_shell onLaunched stub to use chrome.shell.onLaunched
This allows us to remove our hacky chrome.app.runtime stub schema in favor
of a real chrome.shell API generated from an IDL.
Also cleaned up the unused chrome.app.window.create stub and tweaked the
Calculator sample app to allow the use of chrome.shell.onLaunched.
This CL depends on https://codereview.chromium.org/254473011/
BUG=349042
TEST=app_shell --app=<path/to/calculator/app> loads calculator
Review URL: https://codereview.chromium.org/258053010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267462 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'extensions/test/data')
-rw-r--r-- | extensions/test/data/platform_app/background.js | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/extensions/test/data/platform_app/background.js b/extensions/test/data/platform_app/background.js index 9820db7..6e788e0 100644 --- a/extensions/test/data/platform_app/background.js +++ b/extensions/test/data/platform_app/background.js @@ -1,9 +1,16 @@ // 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. -chrome.app.runtime.onLaunched.addListener(function() { - chrome.app.window.create('hello.html', { - 'bounds': { + +// Stub for app_shell. +var createWindow = + chrome.shell ? chrome.shell.createWindow : chrome.app.window.create; +var onLaunched = + chrome.shell ? chrome.shell.onLaunched : chrome.app.runtime.onLaunched; + +onLaunched.addListener(function() { + createWindow('hello.html', { + 'innerBounds': { 'width': 400, 'height': 300 } |