OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/supervised_user/supervised_user_registration_utility.h" | 5 #include "chrome/browser/supervised_user/supervised_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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 CompleteRegistration(true, error); | 356 CompleteRegistration(true, error); |
357 return; | 357 return; |
358 } | 358 } |
359 | 359 |
360 DCHECK(!token.empty()); | 360 DCHECK(!token.empty()); |
361 pending_supervised_user_token_ = token; | 361 pending_supervised_user_token_ = token; |
362 CompleteRegistrationIfReady(); | 362 CompleteRegistrationIfReady(); |
363 } | 363 } |
364 | 364 |
365 void SupervisedUserRegistrationUtilityImpl::CompleteRegistrationIfReady() { | 365 void SupervisedUserRegistrationUtilityImpl::CompleteRegistrationIfReady() { |
366 bool skip_check = CommandLine::ForCurrentProcess()->HasSwitch( | 366 bool skip_check = base::CommandLine::ForCurrentProcess()->HasSwitch( |
367 switches::kNoSupervisedUserAcknowledgmentCheck); | 367 switches::kNoSupervisedUserAcknowledgmentCheck); |
368 | 368 |
369 if (!pending_supervised_user_acknowledged_ && !skip_check) | 369 if (!pending_supervised_user_acknowledged_ && !skip_check) |
370 return; | 370 return; |
371 if (password_update_ && !skip_check) | 371 if (password_update_ && !skip_check) |
372 return; | 372 return; |
373 if (pending_supervised_user_token_.empty()) | 373 if (pending_supervised_user_token_.empty()) |
374 return; | 374 return; |
375 | 375 |
376 GoogleServiceAuthError error(GoogleServiceAuthError::NONE); | 376 GoogleServiceAuthError error(GoogleServiceAuthError::NONE); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 pending_supervised_user_id_); | 408 pending_supervised_user_id_); |
409 } | 409 } |
410 } | 410 } |
411 | 411 |
412 if (run_callback) | 412 if (run_callback) |
413 callback_.Run(error, pending_supervised_user_token_); | 413 callback_.Run(error, pending_supervised_user_token_); |
414 callback_.Reset(); | 414 callback_.Reset(); |
415 } | 415 } |
416 | 416 |
417 } // namespace | 417 } // namespace |
OLD | NEW |