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

Unified Diff: chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler.cc

Issue 144983002: Fixed chrome://settings/accounts availability for MP. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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/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));
}

Powered by Google App Engine
This is Rietveld 408576698