OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 Oobe network screen implementation. | 6 * @fileoverview Oobe network screen implementation. |
7 */ | 7 */ |
8 | 8 |
9 login.createScreen('NetworkScreen', 'connect', function() { | 9 login.createScreen('NetworkScreen', 'connect', function() { |
10 return { | 10 return { |
(...skipping 18 matching lines...) Expand all Loading... |
29 Oobe.setupSelect($('keyboard-select'), | 29 Oobe.setupSelect($('keyboard-select'), |
30 loadTimeData.getValue('inputMethodsList'), | 30 loadTimeData.getValue('inputMethodsList'), |
31 'networkOnInputMethodChanged'); | 31 'networkOnInputMethodChanged'); |
32 | 32 |
33 Oobe.setupSelect($('timezone-select'), | 33 Oobe.setupSelect($('timezone-select'), |
34 loadTimeData.getValue('timezoneList'), | 34 loadTimeData.getValue('timezoneList'), |
35 'networkOnTimezoneChanged'); | 35 'networkOnTimezoneChanged'); |
36 | 36 |
37 this.dropdown_ = $('networks-list'); | 37 this.dropdown_ = $('networks-list'); |
38 cr.ui.DropDown.decorate(this.dropdown_); | 38 cr.ui.DropDown.decorate(this.dropdown_); |
| 39 |
| 40 $('connect-debugging-features-link').addEventListener('click', |
| 41 this.handleDeveloperFeaturesLinkClick_.bind(this)); |
| 42 $('connect-debugging-features-link').addEventListener('keyup', |
| 43 function(event) { |
| 44 if (event.keyCode == 32) |
| 45 this.handleDeveloperFeaturesLinkClick_(event); |
| 46 } |
| 47 ); |
39 }, | 48 }, |
40 | 49 |
41 onBeforeShow: function(data) { | 50 onBeforeShow: function(data) { |
42 cr.ui.DropDown.show('networks-list', true, -1); | 51 cr.ui.DropDown.show('networks-list', true, -1); |
| 52 this.classList.toggle('connect-debugging-view', |
| 53 data && 'isDeveloperMode' in data && data['isDeveloperMode']); |
43 }, | 54 }, |
44 | 55 |
45 onBeforeHide: function() { | 56 onBeforeHide: function() { |
46 cr.ui.DropDown.hide('networks-list'); | 57 cr.ui.DropDown.hide('networks-list'); |
47 this.enableContinueButton(false); | 58 this.enableContinueButton(false); |
48 }, | 59 }, |
49 | 60 |
50 /** | 61 /** |
51 * Header text of the screen. | 62 * Header text of the screen. |
52 * @type {string} | 63 * @type {string} |
(...skipping 24 matching lines...) Expand all Loading... |
77 }, | 88 }, |
78 | 89 |
79 /** | 90 /** |
80 * Returns a control which should receive an initial focus. | 91 * Returns a control which should receive an initial focus. |
81 */ | 92 */ |
82 get defaultControl() { | 93 get defaultControl() { |
83 return $('language-select'); | 94 return $('language-select'); |
84 }, | 95 }, |
85 | 96 |
86 /** | 97 /** |
| 98 * Enable developer features link handler. |
| 99 */ |
| 100 handleDeveloperFeaturesLinkClick_: function() { |
| 101 chrome.send('toggleEnableDebuggingScreen'); |
| 102 }, |
| 103 |
| 104 /** |
87 * Enables/disables continue button. | 105 * Enables/disables continue button. |
88 * @param {boolean} enable Should the button be enabled? | 106 * @param {boolean} enable Should the button be enabled? |
89 */ | 107 */ |
90 enableContinueButton: function(enable) { | 108 enableContinueButton: function(enable) { |
91 $('continue-button').disabled = !enable; | 109 $('continue-button').disabled = !enable; |
92 }, | 110 }, |
93 | 111 |
94 /** | 112 /** |
95 * Sets the current input method. | 113 * Sets the current input method. |
96 * @param {string} inputMethodId The ID of the input method to select. | 114 * @param {string} inputMethodId The ID of the input method to select. |
(...skipping 25 matching lines...) Expand all Loading... |
122 error.appendChild(messageDiv); | 140 error.appendChild(messageDiv); |
123 error.setAttribute('role', 'alert'); | 141 error.setAttribute('role', 'alert'); |
124 | 142 |
125 $('bubble').showContentForElement($('networks-list'), | 143 $('bubble').showContentForElement($('networks-list'), |
126 cr.ui.Bubble.Attachment.BOTTOM, | 144 cr.ui.Bubble.Attachment.BOTTOM, |
127 error); | 145 error); |
128 } | 146 } |
129 }; | 147 }; |
130 }); | 148 }); |
131 | 149 |
OLD | NEW |