Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(190)

Side by Side Diff: chrome/browser/resources/chromeos/login/oobe_screen_network.js

Issue 539273002: Added UI to enable debugging features on CrOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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)
xiyuan 2014/10/30 03:52:08 Seems like we need a button that responds to space
zel 2014/10/31 01:22:26 I've just copies what we already do for accessibil
xiyuan 2014/10/31 03:36:01 Yep, let's just keep it as is.
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.remove('connect-debugging-view');
53 if ('isDeveloperMode' in data && data['isDeveloperMode'])
54 this.classList.add('connect-debugging-view');
xiyuan 2014/10/30 03:52:08 nit: this.classList.toggle('connect-debugging-view
zel 2014/10/31 01:22:26 Done.
43 }, 55 },
44 56
45 onBeforeHide: function() { 57 onBeforeHide: function() {
46 cr.ui.DropDown.hide('networks-list'); 58 cr.ui.DropDown.hide('networks-list');
47 this.enableContinueButton(false); 59 this.enableContinueButton(false);
48 }, 60 },
49 61
50 /** 62 /**
51 * Header text of the screen. 63 * Header text of the screen.
52 * @type {string} 64 * @type {string}
(...skipping 24 matching lines...) Expand all
77 }, 89 },
78 90
79 /** 91 /**
80 * Returns a control which should receive an initial focus. 92 * Returns a control which should receive an initial focus.
81 */ 93 */
82 get defaultControl() { 94 get defaultControl() {
83 return $('language-select'); 95 return $('language-select');
84 }, 96 },
85 97
86 /** 98 /**
99 * Enable developer features link handler.
100 */
101 handleDeveloperFeaturesLinkClick_: function() {
102 chrome.send('toggleEnableDebuggingScreen');
103 },
104
105 /**
87 * Enables/disables continue button. 106 * Enables/disables continue button.
88 * @param {boolean} enable Should the button be enabled? 107 * @param {boolean} enable Should the button be enabled?
89 */ 108 */
90 enableContinueButton: function(enable) { 109 enableContinueButton: function(enable) {
91 $('continue-button').disabled = !enable; 110 $('continue-button').disabled = !enable;
92 }, 111 },
93 112
94 /** 113 /**
95 * Sets the current input method. 114 * Sets the current input method.
96 * @param {string} inputMethodId The ID of the input method to select. 115 * @param {string} inputMethodId The ID of the input method to select.
(...skipping 25 matching lines...) Expand all
122 error.appendChild(messageDiv); 141 error.appendChild(messageDiv);
123 error.setAttribute('role', 'alert'); 142 error.setAttribute('role', 'alert');
124 143
125 $('bubble').showContentForElement($('networks-list'), 144 $('bubble').showContentForElement($('networks-list'),
126 cr.ui.Bubble.Attachment.BOTTOM, 145 cr.ui.Bubble.Attachment.BOTTOM,
127 error); 146 error);
128 } 147 }
129 }; 148 };
130 }); 149 });
131 150
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698