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

Unified Diff: chrome/browser/resources/options/chromeos/network_list.js

Issue 23466015: network_list.js should reflect the correct logged in user type. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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
Index: chrome/browser/resources/options/chromeos/network_list.js
diff --git a/chrome/browser/resources/options/chromeos/network_list.js b/chrome/browser/resources/options/chromeos/network_list.js
index e2ac57c5a831870bbdc42641e56b0f1f192317de..b8b6db13a59754f7480cc5e5600af8f6489b6e82 100644
--- a/chrome/browser/resources/options/chromeos/network_list.js
+++ b/chrome/browser/resources/options/chromeos/network_list.js
@@ -112,6 +112,16 @@ cr.define('options.network', function() {
var defaultIcons_ = {};
/**
+ * Contains the current logged in user type, which is one of 'none',
+ * 'regular', 'owner', 'guest', 'retail-mode', 'public-account',
+ * 'locally-managed', and 'kiosk-app', or empty string if the data has not
+ * been set.
+ * @type {string}
+ * @private
+ */
+ var loggedInUserType_ = '';
+
+ /**
* Create an element in the network list for controlling network
* connectivity.
* @param {Object} data Description of the network list or command.
@@ -463,7 +473,8 @@ cr.define('options.network', function() {
var label = enableDataRoaming_ ? 'disableDataRoaming' :
'enableDataRoaming';
- var disabled = !UIAccountTweaks.currentUserIsOwner();
+ var disabled = !(loggedInUserType_ == 'owner' ||
+ UIAccountTweaks.currentUserIsOwner());
stevenjb 2013/09/10 16:58:05 Do we still need toe UIAccountTweaks check? If so,
armansito 2013/09/10 21:55:19 I originally thought that we should use UIAccountT
var entry = {label: loadTimeData.getString(label),
data: {}};
if (disabled) {
@@ -933,6 +944,14 @@ cr.define('options.network', function() {
};
/**
+ * Sets the current logged in user type.
+ * @param {string} userType Current logged in user type.
+ */
+ NetworkList.updateLoggedInUserType = function(userType) {
+ loggedInUserType_ = String(userType);
+ };
+
+ /**
* Chrome callback for updating network controls.
* @param {Object} data Description of available network devices and their
* corresponding state.

Powered by Google App Engine
This is Rietveld 408576698