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

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

Issue 334283002: New avatar button: Update when the supervised user ID changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 6 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/i18n/case_conversion.h" 9 #include "base/i18n/case_conversion.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 void ProfileInfoCache::SetSupervisedUserIdOfProfileAtIndex( 547 void ProfileInfoCache::SetSupervisedUserIdOfProfileAtIndex(
548 size_t index, 548 size_t index,
549 const std::string& id) { 549 const std::string& id) {
550 if (GetSupervisedUserIdOfProfileAtIndex(index) == id) 550 if (GetSupervisedUserIdOfProfileAtIndex(index) == id)
551 return; 551 return;
552 scoped_ptr<base::DictionaryValue> info( 552 scoped_ptr<base::DictionaryValue> info(
553 GetInfoForProfileAtIndex(index)->DeepCopy()); 553 GetInfoForProfileAtIndex(index)->DeepCopy());
554 info->SetString(kSupervisedUserId, id); 554 info->SetString(kSupervisedUserId, id);
555 // This takes ownership of |info|. 555 // This takes ownership of |info|.
556 SetInfoForProfileAtIndex(index, info.release()); 556 SetInfoForProfileAtIndex(index, info.release());
557
558 base::FilePath profile_path = GetPathOfProfileAtIndex(index);
559 FOR_EACH_OBSERVER(ProfileInfoCacheObserver,
560 observer_list_,
561 OnProfileSupervisedUserIdChanged(profile_path));
557 } 562 }
558 563
559 void ProfileInfoCache::SetLocalAuthCredentialsOfProfileAtIndex( 564 void ProfileInfoCache::SetLocalAuthCredentialsOfProfileAtIndex(
560 size_t index, 565 size_t index,
561 const std::string& credentials) { 566 const std::string& credentials) {
562 scoped_ptr<base::DictionaryValue> info( 567 scoped_ptr<base::DictionaryValue> info(
563 GetInfoForProfileAtIndex(index)->DeepCopy()); 568 GetInfoForProfileAtIndex(index)->DeepCopy());
564 info->SetString(kAuthCredentialsKey, credentials); 569 info->SetString(kAuthCredentialsKey, credentials);
565 // This takes ownership of |info|. 570 // This takes ownership of |info|.
566 SetInfoForProfileAtIndex(index, info.release()); 571 SetInfoForProfileAtIndex(index, info.release());
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
1005 OnProfileAvatarChanged(profile_path)); 1010 OnProfileAvatarChanged(profile_path));
1006 1011
1007 // Remove the file from the list of downloads in progress. Note that this list 1012 // Remove the file from the list of downloads in progress. Note that this list
1008 // only contains the high resolution avatars, and not the Gaia profile images. 1013 // only contains the high resolution avatars, and not the Gaia profile images.
1009 if (!avatar_images_downloads_in_progress_[file_name]) 1014 if (!avatar_images_downloads_in_progress_[file_name])
1010 return; 1015 return;
1011 1016
1012 delete avatar_images_downloads_in_progress_[file_name]; 1017 delete avatar_images_downloads_in_progress_[file_name];
1013 avatar_images_downloads_in_progress_[file_name] = NULL; 1018 avatar_images_downloads_in_progress_[file_name] = NULL;
1014 } 1019 }
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