| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/ui/webui/signin/signin_create_profile_handler.h" | 5 #include "chrome/browser/ui/webui/signin/signin_create_profile_handler.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 GetProfileCreateErrorMessageRemote()); | 583 GetProfileCreateErrorMessageRemote()); |
| 584 } | 584 } |
| 585 } else { | 585 } else { |
| 586 profile_creation_type_ = SUPERVISED_PROFILE_CREATION; | 586 profile_creation_type_ = SUPERVISED_PROFILE_CREATION; |
| 587 std::string new_supervised_user_id = | 587 std::string new_supervised_user_id = |
| 588 SupervisedUserRegistrationUtility::GenerateNewSupervisedUserId(); | 588 SupervisedUserRegistrationUtility::GenerateNewSupervisedUserId(); |
| 589 | 589 |
| 590 // If sync is not yet fully initialized, the creation may take extra | 590 // If sync is not yet fully initialized, the creation may take extra |
| 591 // time, so show a message. Import doesn't wait for an acknowledgment, | 591 // time, so show a message. Import doesn't wait for an acknowledgment, |
| 592 // so it won't have the same potential delay. | 592 // so it won't have the same potential delay. |
| 593 ProfileSyncService* sync_service = | 593 browser_sync::ProfileSyncService* sync_service = |
| 594 ProfileSyncServiceFactory::GetInstance()->GetForProfile( | 594 ProfileSyncServiceFactory::GetInstance()->GetForProfile( |
| 595 custodian_profile); | 595 custodian_profile); |
| 596 ProfileSyncService::SyncStatusSummary status = | 596 browser_sync::ProfileSyncService::SyncStatusSummary status = |
| 597 sync_service->QuerySyncStatusSummary(); | 597 sync_service->QuerySyncStatusSummary(); |
| 598 if (status == ProfileSyncService::DATATYPES_NOT_INITIALIZED) { | 598 if (status == |
| 599 browser_sync::ProfileSyncService::DATATYPES_NOT_INITIALIZED) { |
| 599 ShowProfileCreationWarning(l10n_util::GetStringUTF16( | 600 ShowProfileCreationWarning(l10n_util::GetStringUTF16( |
| 600 IDS_PROFILES_CREATE_SUPERVISED_JUST_SIGNED_IN)); | 601 IDS_PROFILES_CREATE_SUPERVISED_JUST_SIGNED_IN)); |
| 601 } | 602 } |
| 602 | 603 |
| 603 DoCreateProfile(name, icon_url, create_shortcut, new_supervised_user_id, | 604 DoCreateProfile(name, icon_url, create_shortcut, new_supervised_user_id, |
| 604 custodian_profile); | 605 custodian_profile); |
| 605 } | 606 } |
| 606 break; | 607 break; |
| 607 } | 608 } |
| 608 case Profile::CREATE_STATUS_CANCELED: | 609 case Profile::CREATE_STATUS_CANCELED: |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 788 | 789 |
| 789 profiles::OpenBrowserWindowForProfile( | 790 profiles::OpenBrowserWindowForProfile( |
| 790 base::Bind(&SigninCreateProfileHandler::OnBrowserReadyCallback, | 791 base::Bind(&SigninCreateProfileHandler::OnBrowserReadyCallback, |
| 791 weak_ptr_factory_.GetWeakPtr()), | 792 weak_ptr_factory_.GetWeakPtr()), |
| 792 false, // Don't create a window if one already exists. | 793 false, // Don't create a window if one already exists. |
| 793 true, // Create a first run window. | 794 true, // Create a first run window. |
| 794 profile, | 795 profile, |
| 795 Profile::CREATE_STATUS_INITIALIZED); | 796 Profile::CREATE_STATUS_INITIALIZED); |
| 796 } | 797 } |
| 797 #endif | 798 #endif |
| OLD | NEW |