Index: chrome/browser/profiles/profile_window.cc |
diff --git a/chrome/browser/profiles/profile_window.cc b/chrome/browser/profiles/profile_window.cc |
index ea5bb928b2cb09a639d1394052aac1bb7b18a5d4..51d2072aa2965bde03e06ffd65107f7a4ccef196 100644 |
--- a/chrome/browser/profiles/profile_window.cc |
+++ b/chrome/browser/profiles/profile_window.cc |
@@ -310,11 +310,23 @@ void LockProfile(Profile* profile) { |
bool IsLockAvailable(Profile* profile) { |
DCHECK(profile); |
+ if (!switches::IsNewProfileManagement()) |
+ return false; |
+ |
const std::string& hosted_domain = profile->GetPrefs()-> |
GetString(prefs::kGoogleServicesHostedDomain); |
- return switches::IsNewProfileManagement() && |
- (hosted_domain == Profile::kNoHostedDomainFound || |
- hosted_domain == "google.com"); |
+ if (hosted_domain != Profile::kNoHostedDomainFound && |
+ hosted_domain != "google.com") { |
Alexei Svitkine (slow)
2014/10/31 17:13:11
This should probably have a comment about why we'r
|
+ return false; |
+ } |
+ |
+ ProfileInfoCache* cache = |
+ &g_browser_process->profile_manager()->GetProfileInfoCache(); |
Alexei Svitkine (slow)
2014/10/31 17:13:11
Can you use "const ProfileInfoCache&" instead?
|
+ for (size_t i = 0; i < cache->GetNumberOfProfiles(); ++i) { |
+ if (cache->ProfileIsSupervisedAtIndex(i)) |
+ return true; |
+ } |
+ return false; |
} |
void CreateGuestProfileForUserManager( |