OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/profiles/profile_info_cache.h" | 5 #include "chrome/browser/profiles/profile_info_cache.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
10 #include "base/i18n/case_conversion.h" | 10 #include "base/i18n/case_conversion.h" |
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 void ProfileInfoCache::SetProfileSigninRequiredAtIndex(size_t index, | 700 void ProfileInfoCache::SetProfileSigninRequiredAtIndex(size_t index, |
701 bool value) { | 701 bool value) { |
702 if (value == ProfileIsSigninRequiredAtIndex(index)) | 702 if (value == ProfileIsSigninRequiredAtIndex(index)) |
703 return; | 703 return; |
704 | 704 |
705 scoped_ptr<base::DictionaryValue> info( | 705 scoped_ptr<base::DictionaryValue> info( |
706 GetInfoForProfileAtIndex(index)->DeepCopy()); | 706 GetInfoForProfileAtIndex(index)->DeepCopy()); |
707 info->SetBoolean(kSigninRequiredKey, value); | 707 info->SetBoolean(kSigninRequiredKey, value); |
708 // This takes ownership of |info|. | 708 // This takes ownership of |info|. |
709 SetInfoForProfileAtIndex(index, info.release()); | 709 SetInfoForProfileAtIndex(index, info.release()); |
| 710 |
| 711 base::FilePath profile_path = GetPathOfProfileAtIndex(index); |
| 712 FOR_EACH_OBSERVER(ProfileInfoCacheObserver, |
| 713 observer_list_, |
| 714 OnProfileSigninRequiredChanged(profile_path)); |
710 } | 715 } |
711 | 716 |
712 void ProfileInfoCache::SetProfileIsEphemeralAtIndex(size_t index, bool value) { | 717 void ProfileInfoCache::SetProfileIsEphemeralAtIndex(size_t index, bool value) { |
713 if (value == ProfileIsEphemeralAtIndex(index)) | 718 if (value == ProfileIsEphemeralAtIndex(index)) |
714 return; | 719 return; |
715 | 720 |
716 scoped_ptr<base::DictionaryValue> info( | 721 scoped_ptr<base::DictionaryValue> info( |
717 GetInfoForProfileAtIndex(index)->DeepCopy()); | 722 GetInfoForProfileAtIndex(index)->DeepCopy()); |
718 info->SetBoolean(kProfileIsEphemeral, value); | 723 info->SetBoolean(kProfileIsEphemeral, value); |
719 // This takes ownership of |info|. | 724 // This takes ownership of |info|. |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
934 info->GetString(kNameKey, &name); | 939 info->GetString(kNameKey, &name); |
935 names.push_back(name); | 940 names.push_back(name); |
936 } | 941 } |
937 return names; | 942 return names; |
938 } | 943 } |
939 | 944 |
940 // static | 945 // static |
941 void ProfileInfoCache::RegisterPrefs(PrefRegistrySimple* registry) { | 946 void ProfileInfoCache::RegisterPrefs(PrefRegistrySimple* registry) { |
942 registry->RegisterDictionaryPref(prefs::kProfileInfoCache); | 947 registry->RegisterDictionaryPref(prefs::kProfileInfoCache); |
943 } | 948 } |
OLD | NEW |