| 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. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 TODO (alemate): fix this once event flow is updated. | 32 TODO (alemate): fix this once event flow is updated. |
| 33 */ | 33 */ |
| 34 this.show(); | 34 this.show(); |
| 35 }, | 35 }, |
| 36 | 36 |
| 37 /** | 37 /** |
| 38 * This is called from oobe_welcome when this dialog is shown. | 38 * This is called from oobe_welcome when this dialog is shown. |
| 39 */ | 39 */ |
| 40 show: function() { | 40 show: function() { |
| 41 var focusedElements = this.getElementsByClassName('focus-on-show'); | 41 var focusedElements = this.getElementsByClassName('focus-on-show'); |
| 42 if (focusedElements) | 42 if (focusedElements.length > 0) |
| 43 focusedElements[0].focus(); | 43 focusedElements[0].focus(); |
| 44 | 44 |
| 45 this.fire('show-dialog'); | 45 this.fire('show-dialog'); |
| 46 }, | 46 }, |
| 47 }); | 47 }); |
| OLD | NEW |