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 | |
1279 if (!browser_->profile()->GetPrefs()->GetBoolean( | |
1280 prefs::kProfileIsLockable)) { | |
1281 lock_button_->SetState(views::Button::STATE_DISABLED); | |
noms (inactive)
2014/09/12 19:33:26
Same comment as above.
Mike Lerman
2014/09/15 14:08:56
Same response as above.
| |
1282 } | |
1283 | |
1278 layout->StartRow(1, 0); | 1284 layout->StartRow(1, 0); |
1279 layout->AddView(lock_button_); | 1285 layout->AddView(lock_button_); |
1280 } | 1286 } |
1281 return view; | 1287 return view; |
1282 } | 1288 } |
1283 | 1289 |
1284 views::View* ProfileChooserView::CreateSupervisedUserDisclaimerView() { | 1290 views::View* ProfileChooserView::CreateSupervisedUserDisclaimerView() { |
1285 views::View* view = new views::View(); | 1291 views::View* view = new views::View(); |
1286 views::GridLayout* layout = CreateSingleColumnLayout( | 1292 views::GridLayout* layout = CreateSingleColumnLayout( |
1287 view, kFixedMenuWidth - 2 * views::kButtonHEdgeMarginNew); | 1293 view, kFixedMenuWidth - 2 * views::kButtonHEdgeMarginNew); |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1638 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != | 1644 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != |
1639 IncognitoModePrefs::DISABLED; | 1645 IncognitoModePrefs::DISABLED; |
1640 return incognito_available && !browser_->profile()->IsGuestSession(); | 1646 return incognito_available && !browser_->profile()->IsGuestSession(); |
1641 } | 1647 } |
1642 | 1648 |
1643 void ProfileChooserView::PostActionPerformed( | 1649 void ProfileChooserView::PostActionPerformed( |
1644 ProfileMetrics::ProfileDesktopMenu action_performed) { | 1650 ProfileMetrics::ProfileDesktopMenu action_performed) { |
1645 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); | 1651 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); |
1646 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; | 1652 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; |
1647 } | 1653 } |
OLD | NEW |