diff options
author | satorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-21 08:19:03 +0000 |
---|---|---|
committer | satorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-21 08:19:03 +0000 |
commit | ca7b5f504a9383ed53cfeff1346d92766bd917f2 (patch) | |
tree | e2fb2c73d7b5369e6e50d3b426990c3ba13128ee | |
parent | 8a765940622027b07db458519b1d358cb04a27dc (diff) | |
download | chromium_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
-rw-r--r-- | chrome/app/generated_resources.grd | 3 | ||||
-rw-r--r-- | chrome/browser/chromeos/dom_ui/accounts_options_handler.cc | 4 | ||||
-rw-r--r-- | chrome/browser/resources/options/chromeos_accounts_options.html | 5 | ||||
-rw-r--r-- | chrome/browser/resources/options/chromeos_accounts_options.js | 4 | ||||
-rw-r--r-- | chrome/browser/resources/options/chromeos_accounts_options_page.css | 16 | ||||
-rw-r--r-- | chrome/browser/resources/options/warning.png | bin | 0 -> 1045 bytes |
6 files changed, 32 insertions, 0 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 32c45c2..af7346e 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -9485,6 +9485,9 @@ Keep your key file in a safe place. You will need it to create new versions of y <message name="IDS_OPTIONS_ACCOUNTS_ADD_USERS" desc="In the Accounts settings tab, the label text above the user name edit box."> Add users </message> + <message name="IDS_OPTIONS_ACCOUNTS_OWNER_ONLY" desc="In the Accounts settings tab, the warning text noticing that only the owner can modify these settings."> + These settings may only be modified by the owner: + </message> <message name="IDS_OPTIONS_PERSONAL_ACCOUNT_GROUP_NAME" desc="In the Personal Stuff settings tab, the title text for Account section."> Account </message> 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 Binary files differnew file mode 100644 index 0000000..46d78c5 --- /dev/null +++ b/chrome/browser/resources/options/warning.png |