Chromium Code Reviews| Index: chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler.cc |
| diff --git a/chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler.cc b/chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler.cc |
| index 4535febeb19056285f834372aae6a8bf34ca3007..a85199803fc1675cf47acb82f2cee0b94385a174 100644 |
| --- a/chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler.cc |
| +++ b/chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler.cc |
| @@ -44,9 +44,7 @@ bool IsSettingOwnerOnly(const std::string& pref) { |
| // Returns true if |username| is the logged-in owner. |
| bool IsLoggedInOwner(const std::string& username) { |
| - UserManager* user_manager = UserManager::Get(); |
| - return user_manager->IsCurrentUserOwner() && |
| - user_manager->GetLoggedInUser()->email() == username; |
| + return UserManager::Get()->GetOwnerEmail() == username; |
|
Nikita (slow)
2014/01/22 14:45:29
Logic seems to be different now.
Previous code che
ygorshenin1
2014/01/27 09:13:14
Done.
ygorshenin1
2014/01/27 09:13:14
Done.
|
| } |
| // Creates a user info dictionary to be stored in the |ListValue| that is |
| @@ -155,7 +153,7 @@ base::Value* CoreChromeOSOptionsHandler::FetchPref( |
| if (connector->IsEnterpriseManaged()) |
| dict->SetString("controlledBy", "policy"); |
| bool disabled_by_owner = IsSettingOwnerOnly(pref_name) && |
| - !UserManager::Get()->IsCurrentUserOwner(); |
| + !ProfileHelper::IsProfileOwner(Profile::FromWebUI(web_ui())); |
| dict->SetBoolean("disabled", disabled_by_owner); |
| if (disabled_by_owner) |
| dict->SetString("controlledBy", "owner"); |
| @@ -214,7 +212,8 @@ void CoreChromeOSOptionsHandler::GetLocalizedValues( |
| DCHECK(localized_strings); |
| CoreOptionsHandler::GetLocalizedValues(localized_strings); |
| - AddAccountUITweaksLocalizedValues(localized_strings); |
| + AddAccountUITweaksLocalizedValues(localized_strings, |
| + Profile::FromWebUI(web_ui())); |
| localized_strings->SetString("controlledSettingOwner", |
| l10n_util::GetStringUTF16(IDS_OPTIONS_CONTROLLED_SETTING_OWNER)); |
| } |