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 1257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1268 } | 1268 } |
1269 | 1269 |
1270 if (display_lock) { | 1270 if (display_lock) { |
1271 layout->StartRow(1, 0); | 1271 layout->StartRow(1, 0); |
1272 layout->AddView(new views::Separator(views::Separator::HORIZONTAL)); | 1272 layout->AddView(new views::Separator(views::Separator::HORIZONTAL)); |
1273 | 1273 |
1274 lock_button_ = new BackgroundColorHoverButton( | 1274 lock_button_ = new BackgroundColorHoverButton( |
1275 this, | 1275 this, |
1276 l10n_util::GetStringUTF16(IDS_PROFILES_PROFILE_SIGNOUT_BUTTON), | 1276 l10n_util::GetStringUTF16(IDS_PROFILES_PROFILE_SIGNOUT_BUTTON), |
1277 *rb->GetImageSkiaNamed(IDR_ICON_PROFILES_MENU_LOCK)); | 1277 *rb->GetImageSkiaNamed(IDR_ICON_PROFILES_MENU_LOCK)); |
1278 if (!chrome::LocalAuthCredentialsExist(browser_->profile())) | |
1279 lock_button_->SetState(views::Button::STATE_DISABLED); | |
1280 layout->StartRow(1, 0); | 1278 layout->StartRow(1, 0); |
1281 layout->AddView(lock_button_); | 1279 layout->AddView(lock_button_); |
1282 } | 1280 } |
1283 return view; | 1281 return view; |
1284 } | 1282 } |
1285 | 1283 |
1286 views::View* ProfileChooserView::CreateSupervisedUserDisclaimerView() { | 1284 views::View* ProfileChooserView::CreateSupervisedUserDisclaimerView() { |
1287 views::View* view = new views::View(); | 1285 views::View* view = new views::View(); |
1288 views::GridLayout* layout = CreateSingleColumnLayout( | 1286 views::GridLayout* layout = CreateSingleColumnLayout( |
1289 view, kFixedMenuWidth - 2 * views::kButtonHEdgeMarginNew); | 1287 view, kFixedMenuWidth - 2 * views::kButtonHEdgeMarginNew); |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1640 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 1638 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
1641 IncognitoModePrefs::DISABLED; | 1639 IncognitoModePrefs::DISABLED; |
1642 return incognito_available && !browser_->profile()->IsGuestSession(); | 1640 return incognito_available && !browser_->profile()->IsGuestSession(); |
1643 } | 1641 } |
1644 | 1642 |
1645 void ProfileChooserView::PostActionPerformed( | 1643 void ProfileChooserView::PostActionPerformed( |
1646 ProfileMetrics::ProfileDesktopMenu action_performed) { | 1644 ProfileMetrics::ProfileDesktopMenu action_performed) { |
1647 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); | 1645 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); |
1648 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; | 1646 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; |
1649 } | 1647 } |
OLD | NEW |