| 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/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/profiles/profile_info_util.h" | 10 #include "chrome/browser/profiles/profile_info_util.h" |
| (...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 // has no parent (like in tests) because that will also crash. | 514 // has no parent (like in tests) because that will also crash. |
| 515 if (sender->parent()) | 515 if (sender->parent()) |
| 516 sender->SetEnabled(false); | 516 sender->SetEnabled(false); |
| 517 | 517 |
| 518 if (sender == guest_button_) { | 518 if (sender == guest_button_) { |
| 519 profiles::SwitchToGuestProfile(browser_->host_desktop_type(), | 519 profiles::SwitchToGuestProfile(browser_->host_desktop_type(), |
| 520 profiles::ProfileSwitchingDoneCallback()); | 520 profiles::ProfileSwitchingDoneCallback()); |
| 521 } else if (sender == end_guest_button_) { | 521 } else if (sender == end_guest_button_) { |
| 522 profiles::CloseGuestProfileWindows(); | 522 profiles::CloseGuestProfileWindows(); |
| 523 } else if (sender == users_button_) { | 523 } else if (sender == users_button_) { |
| 524 // Only non-guest users appear in the User Manager. | 524 // Guest users cannot appear in the User Manager, nor display a tutorial. |
| 525 base::FilePath profile_path; | 525 profiles::ShowUserManagerMaybeWithTutorial( |
| 526 if (!end_guest_button_) { | 526 end_guest_button_ ? NULL : browser_->profile()); |
| 527 size_t active_index = avatar_menu_->GetActiveProfileIndex(); | |
| 528 profile_path = avatar_menu_->GetItemAt(active_index).profile_path; | |
| 529 } | |
| 530 chrome::ShowUserManager(profile_path); | |
| 531 } else if (sender == add_user_button_) { | 527 } else if (sender == add_user_button_) { |
| 532 profiles::CreateAndSwitchToNewProfile( | 528 profiles::CreateAndSwitchToNewProfile( |
| 533 browser_->host_desktop_type(), | 529 browser_->host_desktop_type(), |
| 534 profiles::ProfileSwitchingDoneCallback(), | 530 profiles::ProfileSwitchingDoneCallback(), |
| 535 ProfileMetrics::ADD_NEW_USER_ICON); | 531 ProfileMetrics::ADD_NEW_USER_ICON); |
| 536 } else if (sender == add_account_button_) { | 532 } else if (sender == add_account_button_) { |
| 537 ShowView(GAIA_ADD_ACCOUNT_VIEW, avatar_menu_.get()); | 533 ShowView(GAIA_ADD_ACCOUNT_VIEW, avatar_menu_.get()); |
| 538 } else if (sender == current_profile_photo_->change_photo_button()) { | 534 } else if (sender == current_profile_photo_->change_photo_button()) { |
| 539 avatar_menu_->EditProfile(avatar_menu_->GetActiveProfileIndex()); | 535 avatar_menu_->EditProfile(avatar_menu_->GetActiveProfileIndex()); |
| 540 } else if (sender == tutorial_ok_button_) { | 536 } else if (sender == tutorial_ok_button_) { |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 956 if (!is_primary_account) { | 952 if (!is_primary_account) { |
| 957 email_button->set_menu_marker(menu_marker); | 953 email_button->set_menu_marker(menu_marker); |
| 958 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); | 954 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
| 959 } | 955 } |
| 960 layout->StartRow(1, 0); | 956 layout->StartRow(1, 0); |
| 961 layout->AddView(email_button); | 957 layout->AddView(email_button); |
| 962 | 958 |
| 963 // Save the original email address, as the button text could be elided. | 959 // Save the original email address, as the button text could be elided. |
| 964 current_profile_accounts_map_[email_button] = account; | 960 current_profile_accounts_map_[email_button] = account; |
| 965 } | 961 } |
| OLD | NEW |