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 954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
965 gfx::Size preferred_size = question_mark_button_->GetPreferredSize(); | 965 gfx::Size preferred_size = question_mark_button_->GetPreferredSize(); |
966 question_mark_button_->SetBounds( | 966 question_mark_button_->SetBounds( |
967 0, 0, preferred_size.width(), preferred_size.height()); | 967 0, 0, preferred_size.width(), preferred_size.height()); |
968 current_profile_photo_->AddChildView(question_mark_button_); | 968 current_profile_photo_->AddChildView(question_mark_button_); |
969 } | 969 } |
970 | 970 |
971 layout->StartRow(1, 0); | 971 layout->StartRow(1, 0); |
972 layout->AddView(current_profile_photo_); | 972 layout->AddView(current_profile_photo_); |
973 | 973 |
974 // Profile name, centered. | 974 // Profile name, centered. |
| 975 bool editing_allowed = !is_guest && !browser_->profile()->IsManaged(); |
975 current_profile_name_ = new EditableProfileName( | 976 current_profile_name_ = new EditableProfileName( |
976 this, profiles::GetAvatarNameForProfile(browser_->profile()), !is_guest); | 977 this, profiles::GetAvatarNameForProfile(browser_->profile()), |
| 978 editing_allowed); |
977 layout->StartRow(1, 0); | 979 layout->StartRow(1, 0); |
978 layout->AddView(current_profile_name_); | 980 layout->AddView(current_profile_name_); |
979 | 981 |
980 if (is_guest) | 982 if (is_guest) |
981 return view; | 983 return view; |
982 | 984 |
983 // The available links depend on the type of profile that is active. | 985 // The available links depend on the type of profile that is active. |
984 layout->StartRow(1, 0); | 986 layout->StartRow(1, 0); |
985 if (avatar_item.signed_in) { | 987 if (avatar_item.signed_in) { |
986 if (switches::IsNewProfileManagement()) { | 988 if (switches::IsNewProfileManagement()) { |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1304 layout->StartRowWithPadding( | 1306 layout->StartRowWithPadding( |
1305 1, 0, 0, views::kUnrelatedControlVerticalSpacing); | 1307 1, 0, 0, views::kUnrelatedControlVerticalSpacing); |
1306 layout->AddView(end_preview_and_relaunch_button_); | 1308 layout->AddView(end_preview_and_relaunch_button_); |
1307 | 1309 |
1308 TitleCard* title_card = new TitleCard( | 1310 TitleCard* title_card = new TitleCard( |
1309 IDS_PROFILES_END_PREVIEW, this, &end_preview_cancel_button_); | 1311 IDS_PROFILES_END_PREVIEW, this, &end_preview_cancel_button_); |
1310 return TitleCard::AddPaddedTitleCard( | 1312 return TitleCard::AddPaddedTitleCard( |
1311 view, title_card, kFixedAccountRemovalViewWidth); | 1313 view, title_card, kFixedAccountRemovalViewWidth); |
1312 } | 1314 } |
1313 | 1315 |
OLD | NEW |