| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/profiles/profile_chooser_view.h" | 5 #include "chrome/browser/ui/views/profiles/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/lifetime/application_lifetime.h" | 10 #include "chrome/browser/lifetime/application_lifetime.h" |
| (...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 664 } else if (sender == end_preview_and_relaunch_button_) { | 664 } else if (sender == end_preview_and_relaunch_button_) { |
| 665 ProfileMetrics::LogProfileUpgradeEnrollment( | 665 ProfileMetrics::LogProfileUpgradeEnrollment( |
| 666 ProfileMetrics::PROFILE_ENROLLMENT_DISABLE_NEW_PROFILE_MGMT); | 666 ProfileMetrics::PROFILE_ENROLLMENT_DISABLE_NEW_PROFILE_MGMT); |
| 667 profiles::DisableNewProfileManagementPreview(); | 667 profiles::DisableNewProfileManagementPreview(); |
| 668 } else if (sender == end_preview_cancel_button_) { | 668 } else if (sender == end_preview_cancel_button_) { |
| 669 tutorial_mode_ = profiles::TUTORIAL_MODE_SEND_FEEDBACK; | 669 tutorial_mode_ = profiles::TUTORIAL_MODE_SEND_FEEDBACK; |
| 670 ShowView(profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER, avatar_menu_.get()); | 670 ShowView(profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER, avatar_menu_.get()); |
| 671 } else if (current_profile_photo_ && | 671 } else if (current_profile_photo_ && |
| 672 sender == current_profile_photo_->change_photo_button()) { | 672 sender == current_profile_photo_->change_photo_button()) { |
| 673 avatar_menu_->EditProfile(avatar_menu_->GetActiveProfileIndex()); | 673 avatar_menu_->EditProfile(avatar_menu_->GetActiveProfileIndex()); |
| 674 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_EDIT_IMAGE); |
| 674 } else if (sender == signin_current_profile_link_) { | 675 } else if (sender == signin_current_profile_link_) { |
| 675 // Only show the inline signin if the new UI flag is flipped. Otherwise, | 676 // Only show the inline signin if the new UI flag is flipped. Otherwise, |
| 676 // use the tab signin page. | 677 // use the tab signin page. |
| 677 if (switches::IsNewProfileManagement()) | 678 if (switches::IsNewProfileManagement()) |
| 678 ShowView(profiles::BUBBLE_VIEW_MODE_GAIA_SIGNIN, avatar_menu_.get()); | 679 ShowView(profiles::BUBBLE_VIEW_MODE_GAIA_SIGNIN, avatar_menu_.get()); |
| 679 else | 680 else |
| 680 chrome::ShowBrowserSignin(browser_, signin::SOURCE_MENU); | 681 chrome::ShowBrowserSignin(browser_, signin::SOURCE_MENU); |
| 681 } else { | 682 } else { |
| 682 // Either one of the "other profiles", or one of the profile accounts | 683 // Either one of the "other profiles", or one of the profile accounts |
| 683 // buttons was pressed. | 684 // buttons was pressed. |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 770 const AvatarMenu::Item& active_item = avatar_menu_->GetItemAt( | 771 const AvatarMenu::Item& active_item = avatar_menu_->GetItemAt( |
| 771 avatar_menu_->GetActiveProfileIndex()); | 772 avatar_menu_->GetActiveProfileIndex()); |
| 772 Profile* profile = g_browser_process->profile_manager()->GetProfile( | 773 Profile* profile = g_browser_process->profile_manager()->GetProfile( |
| 773 active_item.profile_path); | 774 active_item.profile_path); |
| 774 DCHECK(profile); | 775 DCHECK(profile); |
| 775 | 776 |
| 776 if (profile->IsManaged()) | 777 if (profile->IsManaged()) |
| 777 return true; | 778 return true; |
| 778 | 779 |
| 779 profiles::UpdateProfileName(profile, new_profile_name); | 780 profiles::UpdateProfileName(profile, new_profile_name); |
| 781 PostActionPerformed(ProfileMetrics::PROFILE_DESKTOP_MENU_EDIT_NAME); |
| 780 current_profile_name_->ShowReadOnlyView(); | 782 current_profile_name_->ShowReadOnlyView(); |
| 781 return true; | 783 return true; |
| 782 } | 784 } |
| 783 return false; | 785 return false; |
| 784 } | 786 } |
| 785 | 787 |
| 786 void ProfileChooserView::PostActionPerformed( | 788 void ProfileChooserView::PostActionPerformed( |
| 787 ProfileMetrics::ProfileDesktopMenu action_performed) { | 789 ProfileMetrics::ProfileDesktopMenu action_performed) { |
| 788 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); | 790 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); |
| 789 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; | 791 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; |
| (...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1431 layout->StartRowWithPadding( | 1433 layout->StartRowWithPadding( |
| 1432 1, 0, 0, views::kUnrelatedControlVerticalSpacing); | 1434 1, 0, 0, views::kUnrelatedControlVerticalSpacing); |
| 1433 layout->AddView(end_preview_and_relaunch_button_); | 1435 layout->AddView(end_preview_and_relaunch_button_); |
| 1434 | 1436 |
| 1435 TitleCard* title_card = new TitleCard( | 1437 TitleCard* title_card = new TitleCard( |
| 1436 IDS_PROFILES_END_PREVIEW, this, &end_preview_cancel_button_); | 1438 IDS_PROFILES_END_PREVIEW, this, &end_preview_cancel_button_); |
| 1437 return TitleCard::AddPaddedTitleCard( | 1439 return TitleCard::AddPaddedTitleCard( |
| 1438 view, title_card, kFixedAccountRemovalViewWidth); | 1440 view, title_card, kFixedAccountRemovalViewWidth); |
| 1439 } | 1441 } |
| 1440 | 1442 |
| OLD | NEW |