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

Unified Diff: chrome/browser/resources/options/chromeos_internet_network_element.js

Issue 4169001: Rewritten parts of NetworkLibrary to work around memory corruption that prev... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 2 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/mobile_setup.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/options/chromeos_internet_network_element.js
===================================================================
--- chrome/browser/resources/options/chromeos_internet_network_element.js (revision 64441)
+++ chrome/browser/resources/options/chromeos_internet_network_element.js (working copy)
@@ -47,10 +47,7 @@
if (e.button == 0) {
var el = e.target;
// If click is on action buttons of a network item.
- if (el.buttonType && el.networkType && el.servicePath) {
- chrome.send('buttonClickCallback',
- [String(el.networkType), el.servicePath, el.buttonType]);
- } else {
+ if (!(el.buttonType && el.networkType && el.servicePath)) {
if (el.className == 'other-network' || el.buttonType) {
return;
}
@@ -65,8 +62,9 @@
if (item) {
var data = item.data;
- // Don't try to connect to Ethernet.
- if (data && data.networkType == 1)
+ // Don't try to connect to Ethernet or unactivated Cellular.
+ if (data && (data.networkType == 1 ||
+ (data.networkType == 5 && data.activation_state != 1)))
return;
for (var i = 0; i < this.childNodes.length; i++) {
if (this.childNodes[i] != item)
@@ -198,7 +196,7 @@
if (this.data.networkType != NetworkItem.TYPE_ETHERNET &&
!show_activate && this.data.connected) {
buttonsDiv.appendChild(
- this.createButton_('disconnect_button',
+ this.createButton_('disconnect_button', 'disconnect',
function(e) {
chrome.send('buttonClickCallback',
[String(self.data.networkType),
@@ -209,7 +207,7 @@
// Show [Activate] button for non-activated Cellular network.
if (show_activate) {
buttonsDiv.appendChild(
- this.createButton_('activate_button',
+ this.createButton_('activate_button', 'activate',
function(e) {
chrome.send('buttonClickCallback',
[String(self.data.networkType),
@@ -219,7 +217,7 @@
}
if (this.data.connected) {
buttonsDiv.appendChild(
- this.createButton_('options_button',
+ this.createButton_('options_button', 'options',
function(e) {
chrome.send('buttonClickCallback',
[String(self.data.networkType),
@@ -377,8 +375,9 @@
* @param {Object} name The name of the localStrings to use for the text.
* @param {Object} type The type of button.
*/
- createButton_: function(name, callback) {
+ createButton_: function(name, type, callback) {
var buttonEl = this.ownerDocument.createElement('button');
+ buttonEl.buttonType = type;
buttonEl.textContent = localStrings.getString(name);
buttonEl.addEventListener('click', callback);
return buttonEl;
« no previous file with comments | « chrome/browser/resources/mobile_setup.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698