summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorsatorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-21 08:19:03 +0000
committersatorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-21 08:19:03 +0000
commitca7b5f504a9383ed53cfeff1346d92766bd917f2 (patch)
treee2fb2c73d7b5369e6e50d3b426990c3ba13128ee /chrome/browser
parent8a765940622027b07db458519b1d358cb04a27dc (diff)
downloadchromium_src-ca7b5f504a9383ed53cfeff1346d92766bd917f2.zip
chromium_src-ca7b5f504a9383ed53cfeff1346d92766bd917f2.tar.gz
chromium_src-ca7b5f504a9383ed53cfeff1346d92766bd917f2.tar.bz2
Show warning text in the user settings page for non-owner users.
The user settings may only be modified by the owner. We should show a notice about it. This is based on kenmoore's mock. The image was converted from phishing_icon.png: % convert -geometry 17x17 ../shared/images/phishing_icon.png warning.png BUG=chromium-os:9254 TEST=confirmed that the warning text was shown for a non-owner and the guest. Review URL: http://codereview.chromium.org/5965003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69812 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/chromeos/dom_ui/accounts_options_handler.cc4
-rw-r--r--chrome/browser/resources/options/chromeos_accounts_options.html5
-rw-r--r--chrome/browser/resources/options/chromeos_accounts_options.js4
-rw-r--r--chrome/browser/resources/options/chromeos_accounts_options_page.css16
-rw-r--r--chrome/browser/resources/options/warning.pngbin0 -> 1045 bytes
5 files changed, 29 insertions, 0 deletions
diff --git a/chrome/browser/chromeos/dom_ui/accounts_options_handler.cc b/chrome/browser/chromeos/dom_ui/accounts_options_handler.cc
index 628906a..9d9be53 100644
--- a/chrome/browser/chromeos/dom_ui/accounts_options_handler.cc
+++ b/chrome/browser/chromeos/dom_ui/accounts_options_handler.cc
@@ -53,6 +53,10 @@ void AccountsOptionsHandler::GetLocalizedValues(
IDS_OPTIONS_ACCOUNTS_USERNAME_FORMAT));
localized_strings->SetString("add_users",l10n_util::GetStringUTF16(
IDS_OPTIONS_ACCOUNTS_ADD_USERS));
+ localized_strings->SetString("owner_only", l10n_util::GetStringUTF16(
+ IDS_OPTIONS_ACCOUNTS_OWNER_ONLY));
+ localized_strings->SetString("owner_user_id", UTF8ToUTF16(
+ UserCrosSettingsProvider::cached_owner()));
localized_strings->SetString("current_user_is_owner",
UserManager::Get()->current_user_is_owner() ?
diff --git a/chrome/browser/resources/options/chromeos_accounts_options.html b/chrome/browser/resources/options/chromeos_accounts_options.html
index 1ea4bdb..42b5f2e 100644
--- a/chrome/browser/resources/options/chromeos_accounts_options.html
+++ b/chrome/browser/resources/options/chromeos_accounts_options.html
@@ -2,6 +2,11 @@
<h1 i18n-content="accountsPage"></h1>
<section>
<div class="option">
+ <div id="ownerOnlyWarning" class="hidden">
+ <span id="warningIcon"></span>
+ <span i18n-content="owner_only"></span>
+ <span i18n-content="owner_user_id"></span>
+ </div>
<table class="option-control-table">
<tr>
<td class="option-name">
diff --git a/chrome/browser/resources/options/chromeos_accounts_options.js b/chrome/browser/resources/options/chromeos_accounts_options.js
index 349f15b..1a978c6 100644
--- a/chrome/browser/resources/options/chromeos_accounts_options.js
+++ b/chrome/browser/resources/options/chromeos_accounts_options.js
@@ -41,6 +41,10 @@ cr.define('options', function() {
userList.disabled =
userNameEdit.disabled = !AccountsOptions.currentUserIsOwner();
+ // If the current user is not the owner, show some warning.
+ if (!AccountsOptions.currentUserIsOwner()) {
+ $('ownerOnlyWarning').classList.remove('hidden');
+ }
this.addEventListener('visibleChange', this.handleVisibleChange_);
diff --git a/chrome/browser/resources/options/chromeos_accounts_options_page.css b/chrome/browser/resources/options/chromeos_accounts_options_page.css
index f92132f..10aa695 100644
--- a/chrome/browser/resources/options/chromeos_accounts_options_page.css
+++ b/chrome/browser/resources/options/chromeos_accounts_options_page.css
@@ -78,6 +78,22 @@ html[dir=rtl] .remove-user-button {
width: 366px;
}
+#ownerOnlyWarning {
+ margin-bottom: 10px;
+}
+
+#ownerOnlyWarning > * {
+ vertical-align: middle;
+}
+
+#warningIcon {
+ width: 17px;
+ height: 17px;
+ display: inline-block;
+ background-repeat: no-repeat;
+ background-image: url('warning.png');
+}
+
input#userNameEdit:invalid {
background-color: #ff6666;
}
diff --git a/chrome/browser/resources/options/warning.png b/chrome/browser/resources/options/warning.png
new file mode 100644
index 0000000..46d78c5
--- /dev/null
+++ b/chrome/browser/resources/options/warning.png
Binary files differ