| 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/views/profile_chooser_view.h" | 5 #include "chrome/browser/ui/views/profile_chooser_view.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/profiles/profile_info_util.h" | 9 #include "chrome/browser/profiles/profile_info_util.h" |
| 10 #include "chrome/browser/profiles/profile_manager.h" | 10 #include "chrome/browser/profiles/profile_manager.h" |
| (...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 views::View* view = new views::View(); | 591 views::View* view = new views::View(); |
| 592 views::GridLayout* layout = CreateDoubleColumnLayout(view); | 592 views::GridLayout* layout = CreateDoubleColumnLayout(view); |
| 593 layout->SetInsets(views::kButtonVEdgeMarginNew, | 593 layout->SetInsets(views::kButtonVEdgeMarginNew, |
| 594 views::kButtonHEdgeMarginNew, | 594 views::kButtonHEdgeMarginNew, |
| 595 views::kButtonVEdgeMarginNew, | 595 views::kButtonVEdgeMarginNew, |
| 596 views::kButtonHEdgeMarginNew); | 596 views::kButtonHEdgeMarginNew); |
| 597 | 597 |
| 598 current_profile_photo_ = | 598 current_profile_photo_ = |
| 599 new EditableProfilePhoto(this, avatar_item.icon, !is_guest); | 599 new EditableProfilePhoto(this, avatar_item.icon, !is_guest); |
| 600 view->SetBoundsRect(current_profile_photo_->bounds()); | 600 view->SetBoundsRect(current_profile_photo_->bounds()); |
| 601 current_profile_name_ = | 601 current_profile_name_ = new EditableProfileName( |
| 602 new EditableProfileName(this, avatar_item.name, !is_guest); | 602 this, profiles::GetAvatarNameForProfile(browser_->profile()), !is_guest); |
| 603 | |
| 604 layout->StartRow(1, 0); | 603 layout->StartRow(1, 0); |
| 605 layout->AddView(current_profile_photo_, 1, 3); | 604 layout->AddView(current_profile_photo_, 1, 3); |
| 606 layout->AddView(current_profile_name_); | 605 layout->AddView(current_profile_name_); |
| 607 | 606 |
| 608 if (is_guest) { | 607 if (is_guest) { |
| 609 layout->StartRow(1, 0); | 608 layout->StartRow(1, 0); |
| 610 layout->SkipColumns(1); | 609 layout->SkipColumns(1); |
| 611 layout->StartRow(1, 0); | 610 layout->StartRow(1, 0); |
| 612 layout->SkipColumns(1); | 611 layout->SkipColumns(1); |
| 613 } else if (avatar_item.signed_in) { | 612 } else if (avatar_item.signed_in) { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 644 views::View* view = new views::View(); | 643 views::View* view = new views::View(); |
| 645 views::GridLayout* layout = CreateDoubleColumnLayout(view); | 644 views::GridLayout* layout = CreateDoubleColumnLayout(view); |
| 646 layout->SetInsets(views::kButtonVEdgeMarginNew, | 645 layout->SetInsets(views::kButtonVEdgeMarginNew, |
| 647 views::kButtonHEdgeMarginNew, | 646 views::kButtonHEdgeMarginNew, |
| 648 views::kButtonVEdgeMarginNew, | 647 views::kButtonVEdgeMarginNew, |
| 649 views::kButtonHEdgeMarginNew); | 648 views::kButtonHEdgeMarginNew); |
| 650 | 649 |
| 651 current_profile_photo_ = | 650 current_profile_photo_ = |
| 652 new EditableProfilePhoto(this, avatar_item.icon, true); | 651 new EditableProfilePhoto(this, avatar_item.icon, true); |
| 653 view->SetBoundsRect(current_profile_photo_->bounds()); | 652 view->SetBoundsRect(current_profile_photo_->bounds()); |
| 654 current_profile_name_ = | 653 current_profile_name_ = new EditableProfileName( |
| 655 new EditableProfileName(this, avatar_item.name, true); | 654 this, profiles::GetAvatarNameForProfile(browser_->profile()), true); |
| 656 | 655 |
| 657 layout->StartRow(1, 0); | 656 layout->StartRow(1, 0); |
| 658 layout->AddView(current_profile_photo_, 1, 3); | 657 layout->AddView(current_profile_photo_, 1, 3); |
| 659 layout->AddView(current_profile_name_); | 658 layout->AddView(current_profile_name_); |
| 660 | 659 |
| 661 layout->StartRow(1, 0); | 660 layout->StartRow(1, 0); |
| 662 layout->SkipColumns(1); | 661 layout->SkipColumns(1); |
| 663 | 662 |
| 664 layout->StartRow(1, 0); | 663 layout->StartRow(1, 0); |
| 665 layout->SkipColumns(1); | 664 layout->SkipColumns(1); |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 817 if (!is_primary_account) { | 816 if (!is_primary_account) { |
| 818 email_button->set_menu_marker(menu_marker); | 817 email_button->set_menu_marker(menu_marker); |
| 819 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); | 818 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
| 820 } | 819 } |
| 821 layout->StartRow(1, 0); | 820 layout->StartRow(1, 0); |
| 822 layout->AddView(email_button); | 821 layout->AddView(email_button); |
| 823 | 822 |
| 824 // Save the original email address, as the button text could be elided. | 823 // Save the original email address, as the button text could be elided. |
| 825 current_profile_accounts_map_[email_button] = account; | 824 current_profile_accounts_map_[email_button] = account; |
| 826 } | 825 } |
| OLD | NEW |