| OLD | NEW |
| 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/ui/webui/options/create_profile_handler.h" | 5 #include "chrome/browser/ui/webui/options/create_profile_handler.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 | 323 |
| 324 profile_creation_type_ = SUPERVISED_PROFILE_IMPORT; | 324 profile_creation_type_ = SUPERVISED_PROFILE_IMPORT; |
| 325 if (supervised_user_id->empty()) { | 325 if (supervised_user_id->empty()) { |
| 326 profile_creation_type_ = SUPERVISED_PROFILE_CREATION; | 326 profile_creation_type_ = SUPERVISED_PROFILE_CREATION; |
| 327 *supervised_user_id = | 327 *supervised_user_id = |
| 328 SupervisedUserRegistrationUtility::GenerateNewSupervisedUserId(); | 328 SupervisedUserRegistrationUtility::GenerateNewSupervisedUserId(); |
| 329 | 329 |
| 330 // If sync is not yet fully initialized, the creation may take extra time, | 330 // If sync is not yet fully initialized, the creation may take extra time, |
| 331 // so show a message. Import doesn't wait for an acknowledgment, so it | 331 // so show a message. Import doesn't wait for an acknowledgment, so it |
| 332 // won't have the same potential delay. | 332 // won't have the same potential delay. |
| 333 ProfileSyncService* sync_service = | 333 browser_sync::ProfileSyncService* sync_service = |
| 334 ProfileSyncServiceFactory::GetInstance()->GetForProfile( | 334 ProfileSyncServiceFactory::GetInstance()->GetForProfile( |
| 335 Profile::FromWebUI(web_ui())); | 335 Profile::FromWebUI(web_ui())); |
| 336 ProfileSyncService::SyncStatusSummary status = | 336 browser_sync::ProfileSyncService::SyncStatusSummary status = |
| 337 sync_service->QuerySyncStatusSummary(); | 337 sync_service->QuerySyncStatusSummary(); |
| 338 if (status == ProfileSyncService::DATATYPES_NOT_INITIALIZED) { | 338 if (status == |
| 339 browser_sync::ProfileSyncService::DATATYPES_NOT_INITIALIZED) { |
| 339 ShowProfileCreationWarning(l10n_util::GetStringUTF16( | 340 ShowProfileCreationWarning(l10n_util::GetStringUTF16( |
| 340 IDS_PROFILES_CREATE_SUPERVISED_JUST_SIGNED_IN)); | 341 IDS_PROFILES_CREATE_SUPERVISED_JUST_SIGNED_IN)); |
| 341 } | 342 } |
| 342 } | 343 } |
| 343 } | 344 } |
| 344 return true; | 345 return true; |
| 345 } | 346 } |
| 346 | 347 |
| 347 void CreateProfileHandler::HandleCancelProfileCreation( | 348 void CreateProfileHandler::HandleCancelProfileCreation( |
| 348 const base::ListValue* args) { | 349 const base::ListValue* args) { |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 GetProfileAttributesStorage().GetAllProfilesAttributes(); | 474 GetProfileAttributesStorage().GetAllProfilesAttributes(); |
| 474 for (const ProfileAttributesEntry* entry : entries) { | 475 for (const ProfileAttributesEntry* entry : entries) { |
| 475 if (existing_supervised_user_id == entry->GetSupervisedUserId()) | 476 if (existing_supervised_user_id == entry->GetSupervisedUserId()) |
| 476 return false; | 477 return false; |
| 477 } | 478 } |
| 478 return true; | 479 return true; |
| 479 } | 480 } |
| 480 #endif | 481 #endif |
| 481 | 482 |
| 482 } // namespace options | 483 } // namespace options |
| OLD | NEW |