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

Side by Side Diff: chrome/browser/resources/options/chromeos_internet_network_element.js

Issue 4705003: Do not allow network status updates while password field is active. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/resources/options/chromeos_internet_options.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 cr.define('options.internet', function() { 5 cr.define('options.internet', function() {
6 /** 6 /**
7 * Creates a new network list div. 7 * Creates a new network list div.
8 * @param {Object=} opt_propertyBag Optional properties. 8 * @param {Object=} opt_propertyBag Optional properties.
9 * @constructor 9 * @constructor
10 * @extends {HTMLDivElement} 10 * @extends {HTMLDivElement}
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 if (item) { 63 if (item) {
64 var data = item.data; 64 var data = item.data;
65 // Don't try to connect to Ethernet or unactivated Cellular. 65 // Don't try to connect to Ethernet or unactivated Cellular.
66 if (data && (data.networkType == 1 || 66 if (data && (data.networkType == 1 ||
67 (data.networkType == 5 && data.activation_state != 1))) 67 (data.networkType == 5 && data.activation_state != 1)))
68 return; 68 return;
69 for (var i = 0; i < this.childNodes.length; i++) { 69 for (var i = 0; i < this.childNodes.length; i++) {
70 if (this.childNodes[i] != item) 70 if (this.childNodes[i] != item)
71 this.childNodes[i].hidePassword(); 71 this.childNodes[i].hidePassword();
72 } 72 }
73 InternetOptions.unlockUpdates();
73 // If clicked on other networks item. 74 // If clicked on other networks item.
74 if (data && data.servicePath == '?') { 75 if (data && data.servicePath == '?') {
75 item.showOtherLogin(); 76 item.showOtherLogin();
76 } else if (data) { 77 } else if (data) {
77 if (!data.connecting && !data.connected) { 78 if (!data.connecting && !data.connected) {
78 chrome.send('buttonClickCallback', 79 chrome.send('buttonClickCallback',
79 [String(data.networkType), 80 [String(data.networkType),
80 data.servicePath, 81 data.servicePath,
81 'connect']); 82 'connect']);
82 } 83 }
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 285
285 // Disable login button if there is no password. 286 // Disable login button if there is no password.
286 passInput.addEventListener('keyup', function(e) { 287 passInput.addEventListener('keyup', function(e) {
287 buttonEl.disabled = 288 buttonEl.disabled =
288 passInput.value.length < NetworkItem.MIN_WIRELESS_PASSWORD_LENGTH; 289 passInput.value.length < NetworkItem.MIN_WIRELESS_PASSWORD_LENGTH;
289 }); 290 });
290 291
291 passwordDiv.appendChild(buttonEl); 292 passwordDiv.appendChild(buttonEl);
292 this.connecting = true; 293 this.connecting = true;
293 this.appendChild(passwordDiv); 294 this.appendChild(passwordDiv);
295 InternetOptions.lockUpdates();
Charlie Lee 2010/11/09 17:53:45 maybe put this at the beginning of the method?
kochi 2010/11/10 02:31:22 Done.
294 }, 296 },
295 297
296 handleShowPass_: function(e) { 298 handleShowPass_: function(e) {
297 var target = e.target; 299 var target = e.target;
298 if (target.checked) { 300 if (target.checked) {
299 target.target.type = 'text'; 301 target.target.type = 'text';
300 } else { 302 } else {
301 target.target.type = 'password'; 303 target.target.type = 'password';
302 } 304 }
303 }, 305 },
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 ssidInput.value.length >= NetworkItem.MIN_WIRELESS_SSID_LENGTH; 397 ssidInput.value.length >= NetworkItem.MIN_WIRELESS_SSID_LENGTH;
396 var pass_good = 398 var pass_good =
397 securityInput.value == 'none' || 399 securityInput.value == 'none' ||
398 passInput.value.length >= NetworkItem.MIN_WIRELESS_PASSWORD_LENGTH; 400 passInput.value.length >= NetworkItem.MIN_WIRELESS_PASSWORD_LENGTH;
399 buttonEl.disabled = !ssid_good || !pass_good; 401 buttonEl.disabled = !ssid_good || !pass_good;
400 }; 402 };
401 ssidInput.addEventListener('keyup', keyup_listener); 403 ssidInput.addEventListener('keyup', keyup_listener);
402 securityInput.addEventListener('change', keyup_listener); 404 securityInput.addEventListener('change', keyup_listener);
403 passInput.addEventListener('keyup', keyup_listener); 405 passInput.addEventListener('keyup', keyup_listener);
404 this.connecting = true; 406 this.connecting = true;
407 InternetOptions.lockUpdates();
Charlie Lee 2010/11/09 17:53:46 maybe put this at the beginning of the method?
kochi 2010/11/10 02:31:22 Done.
405 }, 408 },
406 409
407 handleLogin_: function(e) { 410 handleLogin_: function(e) {
408 var el = e.target; 411 var el = e.target;
409 var parent = el.parentNode; 412 var parent = el.parentNode;
410 el.disabled = true; 413 el.disabled = true;
411 var input = parent.firstChild; 414 var input = parent.firstChild;
412 input.disabled = true; 415 input.disabled = true;
413 chrome.send('loginToNetwork', [el.servicePath, input.value]); 416 chrome.send('loginToNetwork', [el.servicePath, input.value]);
414 }, 417 },
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 * Whether the underlying network is an other network for adding networks. 460 * Whether the underlying network is an other network for adding networks.
458 * Only used for display purpose. 461 * Only used for display purpose.
459 * @type {boolean} 462 * @type {boolean}
460 */ 463 */
461 cr.defineProperty(NetworkItem, 'other', cr.PropertyKind.BOOL_ATTR); 464 cr.defineProperty(NetworkItem, 'other', cr.PropertyKind.BOOL_ATTR);
462 465
463 return { 466 return {
464 NetworkElement: NetworkElement 467 NetworkElement: NetworkElement
465 }; 468 };
466 }); 469 });
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/options/chromeos_internet_options.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698