Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4201)

Unified Diff: chrome/browser/ui/views/profiles/profile_chooser_view.cc

Issue 497783002: Disable lock if no credentials are present (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Better variable name Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/profiles/profile_chooser_view.cc
diff --git a/chrome/browser/ui/views/profiles/profile_chooser_view.cc b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
index 752dc6637e0fd729c821d827bb97efd71134d594..85855f8b7ace143f78a2212ee2a229e7a3ecfeff 100644
--- a/chrome/browser/ui/views/profiles/profile_chooser_view.cc
+++ b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
@@ -15,6 +15,7 @@
#include "chrome/browser/profiles/profile_metrics.h"
#include "chrome/browser/profiles/profile_window.h"
#include "chrome/browser/profiles/profiles_state.h"
+#include "chrome/browser/signin/local_auth.h"
#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
#include "chrome/browser/signin/signin_header_helper.h"
#include "chrome/browser/signin/signin_manager_factory.h"
@@ -1242,7 +1243,7 @@ views::View* ProfileChooserView::CreateOtherProfilesView(
return view;
}
-views::View* ProfileChooserView::CreateOptionsView(bool enable_lock) {
+views::View* ProfileChooserView::CreateOptionsView(bool display_lock) {
views::View* view = new views::View();
views::GridLayout* layout = CreateSingleColumnLayout(view, kFixedMenuWidth);
@@ -1269,7 +1270,9 @@ views::View* ProfileChooserView::CreateOptionsView(bool enable_lock) {
layout->AddView(go_incognito_button_);
}
- if (enable_lock) {
+ if (display_lock) {
+ bool enable_lock = chrome::LocalAuthCredentialsExist(browser_->profile());
msw 2014/08/22 21:46:49 ditto nit: move down to if statement below (and in
Mike Lerman 2014/08/25 14:44:31 Done, though... I've always liked this form of ess
msw 2014/08/25 17:39:55 If you only use something in an if statement, ther
Mike Lerman 2014/08/25 18:11:37 Okie. Already done.
+
layout->StartRow(1, 0);
layout->AddView(new views::Separator(views::Separator::HORIZONTAL));
@@ -1277,6 +1280,8 @@ views::View* ProfileChooserView::CreateOptionsView(bool enable_lock) {
this,
l10n_util::GetStringUTF16(IDS_PROFILES_PROFILE_SIGNOUT_BUTTON),
*rb->GetImageSkiaNamed(IDR_ICON_PROFILES_MENU_LOCK));
+ if (!enable_lock)
+ lock_button_->SetState(views::Button::STATE_DISABLED);
layout->StartRow(1, 0);
layout->AddView(lock_button_);
}

Powered by Google App Engine
This is Rietveld 408576698