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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 const base::string16& text, | 218 const base::string16& text, |
219 bool is_editing_allowed) | 219 bool is_editing_allowed) |
220 : views::LabelButton(this, text), | 220 : views::LabelButton(this, text), |
221 profile_name_textfield_(NULL) { | 221 profile_name_textfield_(NULL) { |
222 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); | 222 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); |
223 const gfx::FontList& medium_font_list = | 223 const gfx::FontList& medium_font_list = |
224 rb->GetFontList(ui::ResourceBundle::MediumFont); | 224 rb->GetFontList(ui::ResourceBundle::MediumFont); |
225 SetFontList(medium_font_list); | 225 SetFontList(medium_font_list); |
226 SetHorizontalAlignment(gfx::ALIGN_CENTER); | 226 SetHorizontalAlignment(gfx::ALIGN_CENTER); |
227 | 227 |
228 if (!is_editing_allowed) | 228 if (!is_editing_allowed) { |
| 229 SetBorder(views::Border::CreateEmptyBorder(2, 0, 2, 0)); |
229 return; | 230 return; |
| 231 } |
230 | 232 |
231 // Show an "edit" pencil icon when hovering over. In the default state, | 233 // Show an "edit" pencil icon when hovering over. In the default state, |
232 // we need to create an empty placeholder of the correct size, so that | 234 // we need to create an empty placeholder of the correct size, so that |
233 // the text doesn't jump around when the hovered icon appears. | 235 // the text doesn't jump around when the hovered icon appears. |
234 gfx::ImageSkia hover_image = | 236 gfx::ImageSkia hover_image = |
235 *rb->GetImageSkiaNamed(IDR_ICON_PROFILES_EDIT_HOVER); | 237 *rb->GetImageSkiaNamed(IDR_ICON_PROFILES_EDIT_HOVER); |
236 SetImage(STATE_NORMAL, CreateSquarePlaceholderImage(hover_image.width())); | 238 SetImage(STATE_NORMAL, CreateSquarePlaceholderImage(hover_image.width())); |
237 SetImage(STATE_HOVERED, hover_image); | 239 SetImage(STATE_HOVERED, hover_image); |
238 SetImage(STATE_PRESSED, | 240 SetImage(STATE_PRESSED, |
239 *rb->GetImageSkiaNamed(IDR_ICON_PROFILES_EDIT_PRESSED)); | 241 *rb->GetImageSkiaNamed(IDR_ICON_PROFILES_EDIT_PRESSED)); |
(...skipping 1064 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 |