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

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: 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 207746)
+++ 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) {
+ if (profile_downloader_)
Bernhard Bauer 2013/06/21 15:52:07 Should it be a DCHECK to try to download a profile
Pam (message me for reviews) 2013/06/21 16:19:09 Well, since the downloader isn't guaranteed to eve
Bernhard Bauer 2013/06/21 16:46:57 But I don't think silently returning is the correc
Pam (message me for reviews) 2013/06/21 19:20:25 Fair enough. On a second look, as far as I can tel
+ return;
+
+ download_callback_ = callback;
+ download_profile_ = profile;
+ 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();
+}

Powered by Google App Engine
This is Rietveld 408576698