This source file includes following definitions.
- AddAccountUITweaksLocalizedValues
- AddAccountUITweaksLocalizedValues
#include "chrome/browser/ui/webui/chromeos/ui_account_tweaks.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/browser/chromeos/login/user_manager.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chromeos/settings/cros_settings_names.h"
#include "content/public/browser/web_ui_data_source.h"
namespace chromeos {
void AddAccountUITweaksLocalizedValues(
base::DictionaryValue* localized_strings,
Profile* profile) {
DCHECK(localized_strings);
std::string owner_email;
CrosSettings::Get()->GetString(kDeviceOwner, &owner_email);
std::string display_email =
UserManager::Get()->GetUserDisplayEmail(owner_email);
localized_strings->SetString("ownerUserId", display_email);
localized_strings->SetBoolean("currentUserIsOwner",
ProfileHelper::IsOwnerProfile(profile));
localized_strings->SetBoolean("loggedInAsGuest",
UserManager::Get()->IsLoggedInAsGuest());
localized_strings->SetBoolean("loggedInAsLocallyManagedUser",
UserManager::Get()->IsLoggedInAsLocallyManagedUser());
}
void AddAccountUITweaksLocalizedValues(
content::WebUIDataSource* source,
Profile* profile) {
DCHECK(source);
base::DictionaryValue dict;
AddAccountUITweaksLocalizedValues(&dict, profile);
source->AddLocalizedStrings(dict);
}
}