| 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 | 147 |
| 148 // A custom Image control that shows a "change" button when moused over. | 148 // A custom Image control that shows a "change" button when moused over. |
| 149 class EditableProfilePhoto : public views::ImageView { | 149 class EditableProfilePhoto : public views::ImageView { |
| 150 public: | 150 public: |
| 151 EditableProfilePhoto(views::ButtonListener* listener, | 151 EditableProfilePhoto(views::ButtonListener* listener, |
| 152 const gfx::Image& icon, | 152 const gfx::Image& icon, |
| 153 bool is_editing_allowed) | 153 bool is_editing_allowed) |
| 154 : views::ImageView(), | 154 : views::ImageView(), |
| 155 change_photo_button_(NULL) { | 155 change_photo_button_(NULL) { |
| 156 const int kLargeImageSide = 64; | 156 const int kLargeImageSide = 64; |
| 157 gfx::Image image = profiles::GetSizedAvatarIconWithBorder( | 157 gfx::Image image = profiles::GetSizedAvatarIcon( |
| 158 icon, true, | 158 icon, true, |
| 159 kLargeImageSide + profiles::kAvatarIconPadding, | 159 kLargeImageSide + profiles::kAvatarIconPadding, |
| 160 kLargeImageSide + profiles::kAvatarIconPadding); | 160 kLargeImageSide + profiles::kAvatarIconPadding); |
| 161 SetImage(image.ToImageSkia()); | 161 SetImage(image.ToImageSkia()); |
| 162 | 162 |
| 163 if (!is_editing_allowed) | 163 if (!is_editing_allowed) |
| 164 return; | 164 return; |
| 165 | 165 |
| 166 set_notify_enter_exit_on_child(true); | 166 set_notify_enter_exit_on_child(true); |
| 167 | 167 |
| (...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 912 views::GridLayout* layout = CreateSingleColumnLayout( | 912 views::GridLayout* layout = CreateSingleColumnLayout( |
| 913 view, kFixedMenuWidth - 2 * views::kButtonHEdgeMarginNew); | 913 view, kFixedMenuWidth - 2 * views::kButtonHEdgeMarginNew); |
| 914 layout->SetInsets(0, views::kButtonHEdgeMarginNew, | 914 layout->SetInsets(0, views::kButtonHEdgeMarginNew, |
| 915 views::kButtonVEdgeMarginNew, views::kButtonHEdgeMarginNew); | 915 views::kButtonVEdgeMarginNew, views::kButtonHEdgeMarginNew); |
| 916 int num_avatars_to_show = avatars_to_show.size(); | 916 int num_avatars_to_show = avatars_to_show.size(); |
| 917 for (int i = 0; i < num_avatars_to_show; ++i) { | 917 for (int i = 0; i < num_avatars_to_show; ++i) { |
| 918 const size_t index = avatars_to_show[i]; | 918 const size_t index = avatars_to_show[i]; |
| 919 const AvatarMenu::Item& item = avatar_menu_->GetItemAt(index); | 919 const AvatarMenu::Item& item = avatar_menu_->GetItemAt(index); |
| 920 const int kSmallImageSide = 32; | 920 const int kSmallImageSide = 32; |
| 921 | 921 |
| 922 gfx::Image image = profiles::GetSizedAvatarIconWithBorder( | 922 gfx::Image image = profiles::GetSizedAvatarIcon( |
| 923 item.icon, true, | 923 item.icon, true, |
| 924 kSmallImageSide + profiles::kAvatarIconPadding, | 924 kSmallImageSide + profiles::kAvatarIconPadding, |
| 925 kSmallImageSide + profiles::kAvatarIconPadding); | 925 kSmallImageSide + profiles::kAvatarIconPadding); |
| 926 | 926 |
| 927 views::LabelButton* button = new views::LabelButton(this, item.name); | 927 views::LabelButton* button = new views::LabelButton(this, item.name); |
| 928 open_other_profile_indexes_map_[button] = index; | 928 open_other_profile_indexes_map_[button] = index; |
| 929 button->SetImage(views::Button::STATE_NORMAL, *image.ToImageSkia()); | 929 button->SetImage(views::Button::STATE_NORMAL, *image.ToImageSkia()); |
| 930 button->SetFontList(ui::ResourceBundle::GetSharedInstance().GetFontList( | 930 button->SetFontList(ui::ResourceBundle::GetSharedInstance().GetFontList( |
| 931 ui::ResourceBundle::MediumFont)); | 931 ui::ResourceBundle::MediumFont)); |
| 932 button->SetBorder(views::Border::NullBorder()); | 932 button->SetBorder(views::Border::NullBorder()); |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1166 | 1166 |
| 1167 views::View* ProfileChooserView::CreateNewProfileManagementPreviewView() { | 1167 views::View* ProfileChooserView::CreateNewProfileManagementPreviewView() { |
| 1168 return CreateTutorialView( | 1168 return CreateTutorialView( |
| 1169 l10n_util::GetStringUTF16(IDS_PROFILES_PREVIEW_TUTORIAL_TITLE), | 1169 l10n_util::GetStringUTF16(IDS_PROFILES_PREVIEW_TUTORIAL_TITLE), |
| 1170 l10n_util::GetStringUTF16(IDS_PROFILES_PREVIEW_TUTORIAL_CONTENT_TEXT), | 1170 l10n_util::GetStringUTF16(IDS_PROFILES_PREVIEW_TUTORIAL_CONTENT_TEXT), |
| 1171 l10n_util::GetStringUTF16(IDS_PROFILES_PROFILE_TUTORIAL_LEARN_MORE), | 1171 l10n_util::GetStringUTF16(IDS_PROFILES_PROFILE_TUTORIAL_LEARN_MORE), |
| 1172 l10n_util::GetStringUTF16(IDS_PROFILES_TUTORIAL_TRY_BUTTON), | 1172 l10n_util::GetStringUTF16(IDS_PROFILES_TUTORIAL_TRY_BUTTON), |
| 1173 &tutorial_learn_more_link_, | 1173 &tutorial_learn_more_link_, |
| 1174 &tutorial_enable_new_profile_management_button_); | 1174 &tutorial_enable_new_profile_management_button_); |
| 1175 } | 1175 } |
| OLD | NEW |