| 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/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/metrics/user_metrics.h" | 8 #include "base/metrics/user_metrics.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 | 527 |
| 528 profile_name_textfield_ = new views::Textfield(); | 528 profile_name_textfield_ = new views::Textfield(); |
| 529 // Textfield that overlaps the button. | 529 // Textfield that overlaps the button. |
| 530 profile_name_textfield_->set_controller(controller); | 530 profile_name_textfield_->set_controller(controller); |
| 531 profile_name_textfield_->SetFontList(medium_font_list); | 531 profile_name_textfield_->SetFontList(medium_font_list); |
| 532 profile_name_textfield_->SetHorizontalAlignment(gfx::ALIGN_CENTER); | 532 profile_name_textfield_->SetHorizontalAlignment(gfx::ALIGN_CENTER); |
| 533 profile_name_textfield_->SetVisible(false); | 533 profile_name_textfield_->SetVisible(false); |
| 534 AddChildView(profile_name_textfield_); | 534 AddChildView(profile_name_textfield_); |
| 535 | 535 |
| 536 button_ = new RightAlignedIconLabelButton(this, text); | 536 button_ = new RightAlignedIconLabelButton(this, text); |
| 537 button_->SetFontList(medium_font_list); | 537 button_->SetFontListDeprecated(medium_font_list); |
| 538 // Show an "edit" pencil icon when hovering over. In the default state, | 538 // Show an "edit" pencil icon when hovering over. In the default state, |
| 539 // we need to create an empty placeholder of the correct size, so that | 539 // we need to create an empty placeholder of the correct size, so that |
| 540 // the text doesn't jump around when the hovered icon appears. | 540 // the text doesn't jump around when the hovered icon appears. |
| 541 // TODO(estade): revisit colors and press effect. | 541 // TODO(estade): revisit colors and press effect. |
| 542 const int kIconSize = 16; | 542 const int kIconSize = 16; |
| 543 button_->SetImage(views::LabelButton::STATE_NORMAL, | 543 button_->SetImage(views::LabelButton::STATE_NORMAL, |
| 544 CreateSquarePlaceholderImage(kIconSize)); | 544 CreateSquarePlaceholderImage(kIconSize)); |
| 545 button_->SetImage(views::LabelButton::STATE_HOVERED, | 545 button_->SetImage(views::LabelButton::STATE_HOVERED, |
| 546 gfx::CreateVectorIcon( | 546 gfx::CreateVectorIcon( |
| 547 gfx::VectorIconId::MODE_EDIT, kIconSize, | 547 gfx::VectorIconId::MODE_EDIT, kIconSize, |
| (...skipping 1763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2311 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 2311 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
| 2312 IncognitoModePrefs::DISABLED; | 2312 IncognitoModePrefs::DISABLED; |
| 2313 return incognito_available && !browser_->profile()->IsGuestSession(); | 2313 return incognito_available && !browser_->profile()->IsGuestSession(); |
| 2314 } | 2314 } |
| 2315 | 2315 |
| 2316 void ProfileChooserView::PostActionPerformed( | 2316 void ProfileChooserView::PostActionPerformed( |
| 2317 ProfileMetrics::ProfileDesktopMenu action_performed) { | 2317 ProfileMetrics::ProfileDesktopMenu action_performed) { |
| 2318 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); | 2318 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); |
| 2319 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; | 2319 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; |
| 2320 } | 2320 } |
| OLD | NEW |