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

Side by Side Diff: chrome/browser/supervised_user/legacy/custodian_profile_downloader_service.cc

Issue 1091363002: Change ProfileDownloader to use AccountTrackerService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clean up unit test. Created 5 years, 7 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/supervised_user/legacy/custodian_profile_downloader_ser vice.h" 5 #include "chrome/browser/supervised_user/legacy/custodian_profile_downloader_ser vice.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/signin/chrome_signin_client_factory.h"
9 #include "chrome/browser/signin/signin_manager_factory.h" 10 #include "chrome/browser/signin/signin_manager_factory.h"
10 #include "chrome/common/pref_names.h" 11 #include "chrome/common/pref_names.h"
11 #include "components/signin/core/browser/signin_manager.h" 12 #include "components/signin/core/browser/signin_manager.h"
12 #include "google_apis/gaia/gaia_auth_util.h" 13 #include "google_apis/gaia/gaia_auth_util.h"
13 14
14 CustodianProfileDownloaderService::CustodianProfileDownloaderService( 15 CustodianProfileDownloaderService::CustodianProfileDownloaderService(
15 Profile* custodian_profile) 16 Profile* custodian_profile)
16 : custodian_profile_(custodian_profile) { 17 : custodian_profile_(custodian_profile) {
17 } 18 }
18 19
(...skipping 16 matching lines...) Expand all
35 if (gaia::AreEmailsSame(last_downloaded_profile_email_, current_email)) { 36 if (gaia::AreEmailsSame(last_downloaded_profile_email_, current_email)) {
36 // Profile was previously downloaded successfully, use it as it is unlikely 37 // Profile was previously downloaded successfully, use it as it is unlikely
37 // that we will need to download it again. 38 // that we will need to download it again.
38 OnProfileDownloadSuccess(profile_downloader_.get()); 39 OnProfileDownloadSuccess(profile_downloader_.get());
39 return; 40 return;
40 } 41 }
41 // If another profile download is in progress, drop it. It's not worth 42 // If another profile download is in progress, drop it. It's not worth
42 // queueing them up, and more likely that the one that hasn't ended yet is 43 // queueing them up, and more likely that the one that hasn't ended yet is
43 // failing somehow than that the new one won't succeed. 44 // failing somehow than that the new one won't succeed.
44 in_progress_profile_email_ = current_email; 45 in_progress_profile_email_ = current_email;
45 profile_downloader_.reset(new ProfileDownloader(this)); 46 profile_downloader_.reset(
Marc Treib 2015/05/06 21:30:05 nit: Is this a valid way to break the line? I'd wr
anthonyvd 2015/05/14 15:39:23 Done.
47 new ProfileDownloader(this,
48 ChromeSigninClientFactory::GetForProfile(custodian_profile_)));
46 profile_downloader_->Start(); 49 profile_downloader_->Start();
47 } 50 }
48 51
49 bool CustodianProfileDownloaderService::NeedsProfilePicture() const { 52 bool CustodianProfileDownloaderService::NeedsProfilePicture() const {
50 return false; 53 return false;
51 } 54 }
52 55
53 int CustodianProfileDownloaderService::GetDesiredImageSideLength() const { 56 int CustodianProfileDownloaderService::GetDesiredImageSideLength() const {
54 return 0; 57 return 0;
55 } 58 }
(...skipping 14 matching lines...) Expand all
70 last_downloaded_profile_email_ = in_progress_profile_email_; 73 last_downloaded_profile_email_ = in_progress_profile_email_;
71 } 74 }
72 75
73 void CustodianProfileDownloaderService::OnProfileDownloadFailure( 76 void CustodianProfileDownloaderService::OnProfileDownloadFailure(
74 ProfileDownloader* downloader, 77 ProfileDownloader* downloader,
75 ProfileDownloaderDelegate::FailureReason reason) { 78 ProfileDownloaderDelegate::FailureReason reason) {
76 // Ignore failures; proceed without the custodian's name. 79 // Ignore failures; proceed without the custodian's name.
77 download_callback_.Reset(); 80 download_callback_.Reset();
78 profile_downloader_.reset(); 81 profile_downloader_.reset();
79 } 82 }
OLDNEW
« no previous file with comments | « chrome/browser/signin/signin_manager_unittest.cc ('k') | components/signin/core/browser/account_tracker_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698