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

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

Issue 86913002: Make base::Base64Encode() return void (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: One more chromeos-specific fix. 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
« no previous file with comments | « chrome/browser/internal_auth.cc ('k') | chrome/browser/media/desktop_streams_registry.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 bool success = base::Base64Encode(base::RandBytesAsString(8), 153 base::Base64Encode(base::RandBytesAsString(8), &new_managed_user_id);
154 &new_managed_user_id);
155 DCHECK(success);
156 return new_managed_user_id; 154 return new_managed_user_id;
157 } 155 }
158 156
159 // static 157 // static
160 void ManagedUserRegistrationUtility::SetUtilityForTests( 158 void ManagedUserRegistrationUtility::SetUtilityForTests(
161 ManagedUserRegistrationUtility* utility) { 159 ManagedUserRegistrationUtility* utility) {
162 if (g_instance_for_tests) 160 if (g_instance_for_tests)
163 delete g_instance_for_tests; 161 delete g_instance_for_tests;
164 g_instance_for_tests = utility; 162 g_instance_for_tests = utility;
165 } 163 }
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 pending_managed_user_id_); 305 pending_managed_user_id_);
308 } 306 }
309 } 307 }
310 308
311 if (run_callback) 309 if (run_callback)
312 callback_.Run(error, pending_managed_user_token_); 310 callback_.Run(error, pending_managed_user_token_);
313 callback_.Reset(); 311 callback_.Reset();
314 } 312 }
315 313
316 } // namespace 314 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/internal_auth.cc ('k') | chrome/browser/media/desktop_streams_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698