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

Side by Side Diff: chrome/browser/managed_mode/managed_user_registration_utility.cc

Issue 23653007: Avatar syncing for supervised users (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 7 years, 3 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/managed_mode/managed_user_registration_utility.h" 5 #include "chrome/browser/managed_mode/managed_user_registration_utility.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 const RegistrationCallback& callback) { 195 const RegistrationCallback& callback) {
196 DCHECK(pending_managed_user_id_.empty()); 196 DCHECK(pending_managed_user_id_.empty());
197 callback_ = callback; 197 callback_ = callback;
198 pending_managed_user_id_ = managed_user_id; 198 pending_managed_user_id_ = managed_user_id;
199 199
200 const DictionaryValue* dict = prefs_->GetDictionary(prefs::kManagedUsers); 200 const DictionaryValue* dict = prefs_->GetDictionary(prefs::kManagedUsers);
201 is_existing_managed_user_ = dict->HasKey(managed_user_id); 201 is_existing_managed_user_ = dict->HasKey(managed_user_id);
202 if (!is_existing_managed_user_) { 202 if (!is_existing_managed_user_) {
203 managed_user_sync_service_->AddManagedUser(pending_managed_user_id_, 203 managed_user_sync_service_->AddManagedUser(pending_managed_user_id_,
204 base::UTF16ToUTF8(info.name), 204 base::UTF16ToUTF8(info.name),
205 info.master_key); 205 info.master_key,
206 info.avatar_index);
206 } else { 207 } else {
207 // User already exists, don't wait for acknowledgment. 208 // User already exists, don't wait for acknowledgment.
208 OnManagedUserAcknowledged(managed_user_id); 209 OnManagedUserAcknowledged(managed_user_id);
209 } 210 }
210 211
211 browser_sync::DeviceInfo::GetClientName( 212 browser_sync::DeviceInfo::GetClientName(
212 base::Bind(&ManagedUserRegistrationUtilityImpl::FetchToken, 213 base::Bind(&ManagedUserRegistrationUtilityImpl::FetchToken,
213 weak_ptr_factory_.GetWeakPtr())); 214 weak_ptr_factory_.GetWeakPtr()));
214 } 215 }
215 216
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 DCHECK(success); 292 DCHECK(success);
292 managed_user_sync_service_->DeleteManagedUser(pending_managed_user_id_); 293 managed_user_sync_service_->DeleteManagedUser(pending_managed_user_id_);
293 } 294 }
294 295
295 if (run_callback) 296 if (run_callback)
296 callback_.Run(error, pending_managed_user_token_); 297 callback_.Run(error, pending_managed_user_token_);
297 callback_.Reset(); 298 callback_.Reset();
298 } 299 }
299 300
300 } // namespace 301 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698