OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 Polymer({ | 5 Polymer({ |
6 is: 'oobe-dialog', | 6 is: 'oobe-dialog', |
7 | 7 |
8 properties: { | 8 properties: { |
9 /** | 9 /** |
10 * Controls visibility of the bottom-buttons element. | 10 * Controls visibility of the bottom-buttons element. |
11 */ | 11 */ |
12 hasButtons: { | 12 hasButtons: { |
13 type: Boolean, | 13 type: Boolean, |
14 value: false, | 14 value: false, |
15 }, | 15 }, |
16 | 16 |
17 /** | 17 /** |
18 * Switches styles to "Welcome screen". | 18 * Switches styles to "Welcome screen". |
19 */ | 19 */ |
20 welcomeScreen: { | 20 welcomeScreen: { |
21 type: Boolean, | 21 type: Boolean, |
22 value: false, | 22 value: false, |
23 reflectToAttribute: true, | 23 reflectToAttribute: true, |
24 }, | 24 }, |
25 }, | 25 }, |
| 26 |
| 27 focus: function() {}, |
| 28 |
| 29 /** |
| 30 * This is called from oobe_welcome when this dialog is shown. |
| 31 */ |
| 32 show: function() { |
| 33 var focusedElements = this.getElementsByClassName('focus-on-show'); |
| 34 if (focusedElements) |
| 35 focusedElements[0].focus(); |
| 36 |
| 37 this.fire('show-dialog'); |
| 38 }, |
26 }); | 39 }); |
OLD | NEW |