Commit cccd208c authored by rogerta's avatar rogerta Committed by Commit bot

Fix problems found by PREfast.

BUG=427616

Review URL: https://codereview.chromium.org/1010633002

Cr-Commit-Position: refs/heads/master@{#320747}
parent 2e0b0cf7
...@@ -567,13 +567,13 @@ bool InlineLoginHandlerImpl::CanOffer(Profile* profile, ...@@ -567,13 +567,13 @@ bool InlineLoginHandlerImpl::CanOffer(Profile* profile,
// If some profile, not just the current one, is already connected to this // If some profile, not just the current one, is already connected to this
// account, don't show the infobar. // account, don't show the infobar.
if (g_browser_process && !same_email) { if (g_browser_process && !same_email) {
ProfileManager* manager = g_browser_process->profile_manager(); ProfileManager* profile_manager = g_browser_process->profile_manager();
if (manager) { if (profile_manager) {
ProfileInfoCache& cache = manager->GetProfileInfoCache(); ProfileInfoCache& cache = profile_manager->GetProfileInfoCache();
for (size_t i = 0; i < cache.GetNumberOfProfiles(); ++i) { for (size_t i = 0; i < cache.GetNumberOfProfiles(); ++i) {
std::string current_email = std::string profile_email =
base::UTF16ToUTF8(cache.GetUserNameOfProfileAtIndex(i)); base::UTF16ToUTF8(cache.GetUserNameOfProfileAtIndex(i));
if (gaia::AreEmailsSame(email, current_email)) { if (gaia::AreEmailsSame(email, profile_email)) {
if (error_message) { if (error_message) {
error_message->assign( error_message->assign(
l10n_util::GetStringUTF8(IDS_SYNC_USER_NAME_IN_USE_ERROR)); l10n_util::GetStringUTF8(IDS_SYNC_USER_NAME_IN_USE_ERROR));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment