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

Unified Diff: chrome/browser/managed_mode/managed_user_registration_service.cc

Issue 16950018: Collect the custodian's full name when a supervised user is created. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Remove stray blank line Created 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/managed_mode/managed_user_registration_service.cc
===================================================================
--- chrome/browser/managed_mode/managed_user_registration_service.cc (revision 207949)
+++ chrome/browser/managed_mode/managed_user_registration_service.cc (working copy)
@@ -74,7 +74,8 @@
: weak_ptr_factory_(this),
prefs_(prefs),
token_fetcher_(token_fetcher.Pass()),
- pending_managed_user_acknowledged_(false) {
+ pending_managed_user_acknowledged_(false),
+ download_profile_(NULL) {
pref_change_registrar_.Init(prefs);
pref_change_registrar_.Add(
prefs::kGoogleServicesLastUsername,
@@ -143,6 +144,18 @@
weak_ptr_factory_.GetWeakPtr(), info.name));
}
+void ManagedUserRegistrationService::DownloadProfile(
+ Profile* profile,
+ const DownloadProfileCallback& callback) {
+ download_callback_ = callback;
+ download_profile_ = profile;
+ // If another profile download is in progress, drop it. It's not worth
+ // queueing them up, and more likely that the one that hasn't ended yet is
+ // failing somehow than that the new one won't succeed.
+ profile_downloader_.reset(new ProfileDownloader(this));
+ profile_downloader_->Start();
+}
+
void ManagedUserRegistrationService::CancelPendingRegistration() {
AbortPendingRegistration(
false, // Don't run the callback. The error will be ignored.
@@ -399,3 +412,39 @@
pending_managed_user_id_.clear();
pending_managed_user_acknowledged_ = false;
}
+
+bool ManagedUserRegistrationService::NeedsProfilePicture() const {
+ return false;
+}
+
+int ManagedUserRegistrationService::GetDesiredImageSideLength() const {
+ return 0;
+}
+
+std::string ManagedUserRegistrationService::GetCachedPictureURL() const {
+ return std::string();
+}
+
+Profile* ManagedUserRegistrationService::GetBrowserProfile() {
+ DCHECK(download_profile_);
+ return download_profile_;
+}
+
+void ManagedUserRegistrationService::OnProfileDownloadComplete() {
+ download_callback_.Reset();
+ download_profile_ = NULL;
+ profile_downloader_.reset();
+}
+
+void ManagedUserRegistrationService::OnProfileDownloadSuccess(
+ ProfileDownloader* downloader) {
+ download_callback_.Run(downloader->GetProfileFullName());
+ OnProfileDownloadComplete();
+}
+
+void ManagedUserRegistrationService::OnProfileDownloadFailure(
+ ProfileDownloader* downloader,
+ ProfileDownloaderDelegate::FailureReason reason) {
+ // Ignore failures; proceed without the custodian's name.
+ OnProfileDownloadComplete();
+}
« no previous file with comments | « chrome/browser/managed_mode/managed_user_registration_service.h ('k') | chrome/browser/managed_mode/managed_user_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698