OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/webui/signin/inline_login_handler_impl.h" | 5 #include "chrome/browser/ui/webui/signin/inline_login_handler_impl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 error_message->assign( | 560 error_message->assign( |
561 l10n_util::GetStringFUTF8(IDS_SYNC_WRONG_EMAIL, | 561 l10n_util::GetStringFUTF8(IDS_SYNC_WRONG_EMAIL, |
562 base::UTF8ToUTF16(current_email))); | 562 base::UTF8ToUTF16(current_email))); |
563 } | 563 } |
564 return false; | 564 return false; |
565 } | 565 } |
566 | 566 |
567 // If some profile, not just the current one, is already connected to this | 567 // If some profile, not just the current one, is already connected to this |
568 // account, don't show the infobar. | 568 // account, don't show the infobar. |
569 if (g_browser_process && !same_email) { | 569 if (g_browser_process && !same_email) { |
570 ProfileManager* manager = g_browser_process->profile_manager(); | 570 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
571 if (manager) { | 571 if (profile_manager) { |
572 ProfileInfoCache& cache = manager->GetProfileInfoCache(); | 572 ProfileInfoCache& cache = profile_manager->GetProfileInfoCache(); |
573 for (size_t i = 0; i < cache.GetNumberOfProfiles(); ++i) { | 573 for (size_t i = 0; i < cache.GetNumberOfProfiles(); ++i) { |
574 std::string current_email = | 574 std::string profile_email = |
575 base::UTF16ToUTF8(cache.GetUserNameOfProfileAtIndex(i)); | 575 base::UTF16ToUTF8(cache.GetUserNameOfProfileAtIndex(i)); |
576 if (gaia::AreEmailsSame(email, current_email)) { | 576 if (gaia::AreEmailsSame(email, profile_email)) { |
577 if (error_message) { | 577 if (error_message) { |
578 error_message->assign( | 578 error_message->assign( |
579 l10n_util::GetStringUTF8(IDS_SYNC_USER_NAME_IN_USE_ERROR)); | 579 l10n_util::GetStringUTF8(IDS_SYNC_USER_NAME_IN_USE_ERROR)); |
580 } | 580 } |
581 return false; | 581 return false; |
582 } | 582 } |
583 } | 583 } |
584 } | 584 } |
585 } | 585 } |
586 } | 586 } |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
776 } | 776 } |
777 } | 777 } |
778 | 778 |
779 if (show_account_management) { | 779 if (show_account_management) { |
780 browser->window()->ShowAvatarBubbleFromAvatarButton( | 780 browser->window()->ShowAvatarBubbleFromAvatarButton( |
781 BrowserWindow::AVATAR_BUBBLE_MODE_ACCOUNT_MANAGEMENT, | 781 BrowserWindow::AVATAR_BUBBLE_MODE_ACCOUNT_MANAGEMENT, |
782 signin::ManageAccountsParams()); | 782 signin::ManageAccountsParams()); |
783 } | 783 } |
784 } | 784 } |
785 } | 785 } |
OLD | NEW |