| 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 1480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1491 } | 1491 } |
| 1492 | 1492 |
| 1493 views::View* ProfileChooserView::CreateOptionsView(bool display_lock) { | 1493 views::View* ProfileChooserView::CreateOptionsView(bool display_lock) { |
| 1494 views::View* view = new views::View(); | 1494 views::View* view = new views::View(); |
| 1495 views::GridLayout* layout = CreateSingleColumnLayout(view, kFixedMenuWidth); | 1495 views::GridLayout* layout = CreateSingleColumnLayout(view, kFixedMenuWidth); |
| 1496 | 1496 |
| 1497 base::string16 text = browser_->profile()->IsGuestSession() ? | 1497 base::string16 text = browser_->profile()->IsGuestSession() ? |
| 1498 l10n_util::GetStringUTF16(IDS_PROFILES_EXIT_GUEST) : | 1498 l10n_util::GetStringUTF16(IDS_PROFILES_EXIT_GUEST) : |
| 1499 l10n_util::GetStringUTF16(IDS_PROFILES_MANAGE_USERS_BUTTON); | 1499 l10n_util::GetStringUTF16(IDS_PROFILES_MANAGE_USERS_BUTTON); |
| 1500 const int kIconSize = 16; | 1500 const int kIconSize = 16; |
| 1501 |
| 1502 gfx::VectorIconId settings_icon = switches::IsMaterialDesignUserMenu() ? |
| 1503 gfx::VectorIconId::SETTINGS : gfx::VectorIconId::ACCOUNT_BOX; |
| 1501 users_button_ = new BackgroundColorHoverButton( | 1504 users_button_ = new BackgroundColorHoverButton( |
| 1502 this, text, gfx::CreateVectorIcon(gfx::VectorIconId::ACCOUNT_BOX, | 1505 this, text, gfx::CreateVectorIcon(settings_icon, kIconSize, |
| 1503 kIconSize, gfx::kChromeIconGrey)); | 1506 gfx::kChromeIconGrey)); |
| 1507 |
| 1504 layout->StartRow(1, 0); | 1508 layout->StartRow(1, 0); |
| 1505 layout->AddView(users_button_); | 1509 layout->AddView(users_button_); |
| 1506 | 1510 |
| 1507 if (display_lock) { | 1511 if (display_lock) { |
| 1508 layout->StartRow(1, 0); | 1512 layout->StartRow(1, 0); |
| 1509 layout->AddView(new views::Separator(views::Separator::HORIZONTAL)); | 1513 layout->AddView(new views::Separator(views::Separator::HORIZONTAL)); |
| 1510 | 1514 |
| 1511 lock_button_ = new BackgroundColorHoverButton( | 1515 lock_button_ = new BackgroundColorHoverButton( |
| 1512 this, l10n_util::GetStringUTF16(IDS_PROFILES_PROFILE_SIGNOUT_BUTTON), | 1516 this, l10n_util::GetStringUTF16(IDS_PROFILES_PROFILE_SIGNOUT_BUTTON), |
| 1513 gfx::CreateVectorIcon(gfx::VectorIconId::LOCK, kIconSize, | 1517 gfx::CreateVectorIcon(gfx::VectorIconId::LOCK, kIconSize, |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1868 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 1872 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
| 1869 IncognitoModePrefs::DISABLED; | 1873 IncognitoModePrefs::DISABLED; |
| 1870 return incognito_available && !browser_->profile()->IsGuestSession(); | 1874 return incognito_available && !browser_->profile()->IsGuestSession(); |
| 1871 } | 1875 } |
| 1872 | 1876 |
| 1873 void ProfileChooserView::PostActionPerformed( | 1877 void ProfileChooserView::PostActionPerformed( |
| 1874 ProfileMetrics::ProfileDesktopMenu action_performed) { | 1878 ProfileMetrics::ProfileDesktopMenu action_performed) { |
| 1875 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); | 1879 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); |
| 1876 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; | 1880 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; |
| 1877 } | 1881 } |
| OLD | NEW |