Chromium Code Reviews| 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 | 26 |
| 27 focus: function() {}, | 27 focus: function() { |
| 28 /* When Network Selection Dialog is shown because user pressed "Back" | |
| 29 button on EULA screen display_manager does not inform this dialog that | |
| 30 it is shown. It ouly focuses this dialog. | |
| 31 So this emulates show(). | |
| 32 TODO (alemate): fix this once event flow is updated. | |
|
achuithb
2017/02/20 01:08:16
Is there a bug?
Alexander Alekseev
2017/02/21 21:55:44
It should probably be called "remove old OOBE code
| |
| 33 */ | |
| 34 this.show(); | |
| 35 }, | |
| 28 | 36 |
| 29 /** | 37 /** |
| 30 * This is called from oobe_welcome when this dialog is shown. | 38 * This is called from oobe_welcome when this dialog is shown. |
| 31 */ | 39 */ |
| 32 show: function() { | 40 show: function() { |
| 33 var focusedElements = this.getElementsByClassName('focus-on-show'); | 41 var focusedElements = this.getElementsByClassName('focus-on-show'); |
| 34 if (focusedElements) | 42 if (focusedElements) |
| 35 focusedElements[0].focus(); | 43 focusedElements[0].focus(); |
| 36 | 44 |
| 37 this.fire('show-dialog'); | 45 this.fire('show-dialog'); |
| 38 }, | 46 }, |
| 39 }); | 47 }); |
| OLD | NEW |