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 /** | 5 /** |
6 * @fileoverview Polymer element for displaying material design Terms Of Service | 6 * @fileoverview Polymer element for displaying material design Terms Of Service |
7 * screen. | 7 * screen. |
8 */ | 8 */ |
9 | 9 |
10 Polymer({ | 10 Polymer({ |
11 is: 'oobe-eula-md', | 11 is: 'oobe-eula-md', |
12 | 12 |
13 properties: { | 13 properties: { |
14 /** | 14 /** |
15 * Shows "Loading..." section. | 15 * Shows "Loading..." section. |
16 */ | 16 */ |
17 eulaLoadingScreenShown: { | 17 eulaLoadingScreenShown: { |
18 type: Boolean, | 18 type: Boolean, |
19 value: false, | 19 value: false, |
20 }, | 20 }, |
21 | 21 |
22 /** | 22 /** |
23 * Shows Terms Of Service frame. | |
24 */ | |
25 eulaScreenShown: { | |
26 type: Array, | |
27 }, | |
28 | |
29 /** | |
30 * "Accepot and continue" button is disabled until content is loaded. | 23 * "Accepot and continue" button is disabled until content is loaded. |
31 */ | 24 */ |
32 acceptButtonDisabled: { | 25 acceptButtonDisabled: { |
33 type: Boolean, | 26 type: Boolean, |
34 value: true, | 27 value: true, |
35 }, | 28 }, |
36 | 29 |
37 /** | 30 /** |
38 * If "Report anonymous usage stats" checkbox is checked. | 31 * If "Report anonymous usage stats" checkbox is checked. |
39 */ | 32 */ |
40 usageStatsChecked: { | 33 usageStatsChecked: { |
41 type: Boolean, | 34 type: Boolean, |
42 value: false, | 35 value: false, |
43 }, | 36 }, |
44 | 37 |
45 /** | 38 /** |
46 * Reference to OOBE screen object. | 39 * Reference to OOBE screen object. |
47 * @type {!OobeTypes.Screen} | 40 * @type {!OobeTypes.Screen} |
48 */ | 41 */ |
49 screen: { | 42 screen: { |
50 type: Object, | 43 type: Object, |
51 }, | 44 }, |
52 }, | 45 }, |
53 | 46 |
| 47 focus: function() { |
| 48 if (this.eulaLoadingScreenShown) { |
| 49 this.$.eulaLoadingDialog.show(); |
| 50 } else { |
| 51 this.$.eulaDialog.show(); |
| 52 } |
| 53 }, |
| 54 |
54 /** | 55 /** |
55 * Event handler that is invoked when 'chrome://terms' is loaded. | 56 * Event handler that is invoked when 'chrome://terms' is loaded. |
56 */ | 57 */ |
57 onFrameLoad_: function() { | 58 onFrameLoad_: function() { |
58 this.acceptButtonDisabled = false; | 59 this.acceptButtonDisabled = false; |
59 }, | 60 }, |
60 | 61 |
61 /** | 62 /** |
62 * This is called when strings are updated. | 63 * This is called when strings are updated. |
63 */ | 64 */ |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 | 105 |
105 /** | 106 /** |
106 * On-tap event handler for back button. | 107 * On-tap event handler for back button. |
107 * | 108 * |
108 * @private | 109 * @private |
109 */ | 110 */ |
110 onEulaBackButtonPressed_: function() { | 111 onEulaBackButtonPressed_: function() { |
111 chrome.send('login.EulaScreen.userActed', ['back-button']); | 112 chrome.send('login.EulaScreen.userActed', ['back-button']); |
112 }, | 113 }, |
113 }); | 114 }); |
OLD | NEW |