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

Unified Diff: chrome/browser/profiles/profile_info_cache.cc

Issue 777993003: Add ProfileInfoCache::ProfileIsChild/IsLegacySupervisedAtIndex. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@unicorn_upstream
Patch Set: Created 6 years 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
« no previous file with comments | « chrome/browser/profiles/profile_info_cache.h ('k') | chrome/browser/profiles/profile_info_interface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_info_cache.cc
diff --git a/chrome/browser/profiles/profile_info_cache.cc b/chrome/browser/profiles/profile_info_cache.cc
index 3079a62d1774cb8f629f6c0eae271cc1ff30bba2..4e6803e2ceb57727fbdd9386df1918ab01c384ac 100644
--- a/chrome/browser/profiles/profile_info_cache.cc
+++ b/chrome/browser/profiles/profile_info_cache.cc
@@ -33,6 +33,10 @@
#include "ui/gfx/image/image.h"
#include "ui/gfx/image/image_util.h"
+#if defined(ENABLE_SUPERVISED_USERS)
+#include "chrome/browser/supervised_user/supervised_user_constants.h"
+#endif
+
using content::BrowserThread;
namespace {
@@ -399,6 +403,19 @@ bool ProfileInfoCache::ProfileIsSupervisedAtIndex(size_t index) const {
return !GetSupervisedUserIdOfProfileAtIndex(index).empty();
}
+bool ProfileInfoCache::ProfileIsChildAtIndex(size_t index) const {
+#if defined(ENABLE_SUPERVISED_USERS)
+ return GetSupervisedUserIdOfProfileAtIndex(index) ==
+ supervised_users::kChildAccountSUID;
+#else
+ return false;
+#endif
+}
+
+bool ProfileInfoCache::ProfileIsLegacySupervisedAtIndex(size_t index) const {
+ return ProfileIsSupervisedAtIndex(index) && !ProfileIsChildAtIndex(index);
+}
+
bool ProfileInfoCache::IsOmittedProfileAtIndex(size_t index) const {
bool value = false;
GetInfoForProfileAtIndex(index)->GetBoolean(kIsOmittedFromProfileListKey,
« no previous file with comments | « chrome/browser/profiles/profile_info_cache.h ('k') | chrome/browser/profiles/profile_info_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698