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

Unified Diff: chrome/browser/signin/local_auth.cc

Issue 497783002: Disable lock if no credentials are present (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/signin/local_auth.cc
diff --git a/chrome/browser/signin/local_auth.cc b/chrome/browser/signin/local_auth.cc
index 55b955e25fd7a467bac1959d3637ea8ddec4ad32..fbae835bd0a0137c156cc366b845a78e738d4224 100644
--- a/chrome/browser/signin/local_auth.cc
+++ b/chrome/browser/signin/local_auth.cc
@@ -198,4 +198,28 @@ bool ValidateLocalAuthCredentials(const Profile* profile,
return ValidateLocalAuthCredentials(info_index, password);
}
+bool LocalAuthCredentialsExist(size_t info_index) {
+ ProfileInfoCache& info =
+ g_browser_process->profile_manager()->GetProfileInfoCache();
+
+ std::string encodedhash =
+ info.GetLocalAuthCredentialsOfProfileAtIndex(info_index);
+
+ return !encodedhash.empty();
+}
+
+bool LocalAuthCredentialsExist(const Profile* profile) {
+ DCHECK(profile);
+
+ ProfileInfoCache& info =
+ g_browser_process->profile_manager()->GetProfileInfoCache();
+ size_t info_index = info.GetIndexOfProfileWithPath(profile->GetPath());
+ if (info_index == std::string::npos) {
+ NOTREACHED(); // This should never happen but fail safely if it does.
+ return false;
+ }
+ return LocalAuthCredentialsExist(info_index);
+
+}
+
} // namespace chrome

Powered by Google App Engine
This is Rietveld 408576698