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

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

Issue 101113004: Revert 239759 "The comment in base64.h implies that base::Base64..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years 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
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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 ManagedUserSyncServiceFactory::GetForProfile(profile); 143 ManagedUserSyncServiceFactory::GetForProfile(profile);
144 return make_scoped_ptr(ManagedUserRegistrationUtility::CreateImpl( 144 return make_scoped_ptr(ManagedUserRegistrationUtility::CreateImpl(
145 profile->GetPrefs(), 145 profile->GetPrefs(),
146 token_fetcher.Pass(), 146 token_fetcher.Pass(),
147 managed_user_sync_service)); 147 managed_user_sync_service));
148 } 148 }
149 149
150 // static 150 // static
151 std::string ManagedUserRegistrationUtility::GenerateNewManagedUserId() { 151 std::string ManagedUserRegistrationUtility::GenerateNewManagedUserId() {
152 std::string new_managed_user_id; 152 std::string new_managed_user_id;
153 base::Base64Encode(base::RandBytesAsString(8), &new_managed_user_id); 153 bool success = base::Base64Encode(base::RandBytesAsString(8),
154 &new_managed_user_id);
155 DCHECK(success);
154 return new_managed_user_id; 156 return new_managed_user_id;
155 } 157 }
156 158
157 // static 159 // static
158 void ManagedUserRegistrationUtility::SetUtilityForTests( 160 void ManagedUserRegistrationUtility::SetUtilityForTests(
159 ManagedUserRegistrationUtility* utility) { 161 ManagedUserRegistrationUtility* utility) {
160 if (g_instance_for_tests) 162 if (g_instance_for_tests)
161 delete g_instance_for_tests; 163 delete g_instance_for_tests;
162 g_instance_for_tests = utility; 164 g_instance_for_tests = utility;
163 } 165 }
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 pending_managed_user_id_); 307 pending_managed_user_id_);
306 } 308 }
307 } 309 }
308 310
309 if (run_callback) 311 if (run_callback)
310 callback_.Run(error, pending_managed_user_token_); 312 callback_.Run(error, pending_managed_user_token_);
311 callback_.Reset(); 313 callback_.Reset();
312 } 314 }
313 315
314 } // namespace 316 } // namespace
OLDNEW
« no previous file with comments | « trunk/src/chrome/browser/internal_auth.cc ('k') | trunk/src/chrome/browser/media/desktop_streams_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698