X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fchrome%2Fbrowser%2Fprofiles%2Fprofile_info_cache.cc;h=6713d21f73f22c86397160cc5aa791f840dcc8d4;hb=ff3e2503a20db9193d323c1d19c38c68004dec4a;hp=d9ff4ee37060e842b5ae61b70a3bcc18eb2eb507;hpb=7338fba38ba696536d1cc9d389afd716a6ab2fe6;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/chrome/browser/profiles/profile_info_cache.cc b/src/chrome/browser/profiles/profile_info_cache.cc index d9ff4ee..6713d21 100644 --- a/src/chrome/browser/profiles/profile_info_cache.cc +++ b/src/chrome/browser/profiles/profile_info_cache.cc @@ -50,6 +50,7 @@ const char kBackgroundAppsKey[] = "background_apps"; const char kHasMigratedToGAIAInfoKey[] = "has_migrated_to_gaia_info"; const char kGAIAPictureFileNameKey[] = "gaia_picture_file_name"; const char kIsManagedKey[] = "is_managed"; +const char kIsOmittedFromProfileListKey[] = "is_omitted_from_profile_list"; const char kSigninRequiredKey[] = "signin_required"; const char kManagedUserId[] = "managed_user_id"; const char kProfileIsEphemeral[] = "is_ephemeral"; @@ -218,6 +219,7 @@ void ProfileInfoCache::AddProfileToCache(const base::FilePath& profile_path, // Default value for whether background apps are running is false. info->SetBoolean(kBackgroundAppsKey, false); info->SetString(kManagedUserId, managed_user_id); + info->SetBoolean(kIsOmittedFromProfileListKey, !managed_user_id.empty()); info->SetBoolean(kProfileIsEphemeral, false); cache->SetWithoutPathExpansion(key, info.release()); @@ -412,6 +414,13 @@ bool ProfileInfoCache::ProfileIsManagedAtIndex(size_t index) const { return !GetManagedUserIdOfProfileAtIndex(index).empty(); } +bool ProfileInfoCache::IsOmittedProfileAtIndex(size_t index) const { + bool value = false; + GetInfoForProfileAtIndex(index)->GetBoolean(kIsOmittedFromProfileListKey, + &value); + return value; +} + bool ProfileInfoCache::ProfileIsSigninRequiredAtIndex(size_t index) const { bool value = false; GetInfoForProfileAtIndex(index)->GetBoolean(kSigninRequiredKey, &value); @@ -555,6 +564,17 @@ void ProfileInfoCache::SetAvatarIconOfProfileAtIndex(size_t index, OnProfileAvatarChanged(profile_path)); } +void ProfileInfoCache::SetIsOmittedProfileAtIndex(size_t index, + bool is_omitted) { + if (IsOmittedProfileAtIndex(index) == is_omitted) + return; + scoped_ptr info( + GetInfoForProfileAtIndex(index)->DeepCopy()); + info->SetBoolean(kIsOmittedFromProfileListKey, is_omitted); + // This takes ownership of |info|. + SetInfoForProfileAtIndex(index, info.release()); +} + void ProfileInfoCache::SetManagedUserIdOfProfileAtIndex(size_t index, const std::string& id) { scoped_ptr info(