Chromium Code Reviews| Index: chrome/browser/resources/chromeos/login/screen_app_launch_splash.js |
| diff --git a/chrome/browser/resources/chromeos/login/screen_app_launch_splash.js b/chrome/browser/resources/chromeos/login/screen_app_launch_splash.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6c9c92a319ab360accc4d7616e8f83d4371866e6 |
| --- /dev/null |
| +++ b/chrome/browser/resources/chromeos/login/screen_app_launch_splash.js |
| @@ -0,0 +1,67 @@ |
| +// Copyright (c) 2013 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. |
| + |
| +/** |
| + * @fileoverview App install/launch splash screen implementation. |
| + */ |
| + |
| +login.createScreen('AppLaunchSplashScreen', 'app-launch-splash', function() { |
| + return { |
| + EXTERNAL_API: [ |
| + 'toggleNetworkConfig', |
| + 'updateApp', |
| + 'updateMessage', |
| + ], |
| + |
| + /** |
| + * Event handler that is invoked just before the frame is shown. |
| + * @param {string} data Screen init payload. |
| + */ |
| + onBeforeShow: function(data) { |
| + disableTextSelectAndDrag(); |
|
xiyuan
2013/08/15 18:19:42
Don't think we need this. Select and drag should b
Tim Song
2013/08/16 19:07:59
Done. This is indeed the case.
|
| + |
| + this.updateApp(data['appInfo']); |
| + |
| + var shortcutEnabled = data['shortcutEnabled']; |
| + $('splash-shortcut-info').hidden = |
| + shortcutEnabled != null ? !shortcutEnabled : true; |
|
xiyuan
2013/08/15 18:19:42
How could |shortcutEnabled| be null?
Tim Song
2013/08/16 19:07:59
Done. We'll always pass in this field when we show
|
| + window.webkitRequestAnimationFrame(function() {}); |
|
xiyuan
2013/08/15 18:19:42
This seems not needed.
Tim Song
2013/08/16 19:07:59
Done.
|
| + |
| + Oobe.getInstance().headerHidden = true; |
| + }, |
| + |
| + /** |
| + * Event handler that is invoked just before the frame is hidden. |
| + */ |
| + onBeforeHide: function() { |
| + // Re-enable text select and drag. |
| + disableTextSelectAndDrag(true, true); |
|
xiyuan
2013/08/15 18:19:42
Why do we need to do it here?
Tim Song
2013/08/16 19:07:59
Done.
|
| + }, |
| + |
| + /** |
| + * Toggles visibility of the network configuration option. |
| + * @param {boolean} visible Whether to show the option. |
| + */ |
| + toggleNetworkConfig: function(visible) { |
| + // TODO(tengs): Implement network configuration in app launch. |
| + }, |
| + |
| + /** |
| + * Updates the app name and icon. |
| + * @param {Object} app Details of app being launched. |
| + */ |
| + updateApp: function(app) { |
| + $('splash-header').textContent = app.name; |
| + $('splash-header').style.backgroundImage = 'url(' + app.iconURL + ')'; |
| + }, |
| + |
| + /** |
| + * Updates the message for the current launch state. |
| + * @param {string} message Description for current launch state. |
| + */ |
| + updateMessage: function(message) { |
| + $('splash-launch-text').textContent = message; |
| + }, |
|
xiyuan
2013/08/15 18:19:42
nit: no ',' for the last property.
Tim Song
2013/08/16 19:07:59
Done.
|
| + }; |
| +}); |