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

Side by Side Diff: chrome/browser/profiles/profile_info_cache.cc

Issue 128553002: Add a new method to the ProfileInfoCacheObserver for signin status changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_info_cache_observer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_info_cache_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698