| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/profiles/profile_impl.h" | 5 #include "chrome/browser/profiles/profile_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 io_data_(this), | 429 io_data_(this), |
| 430 last_session_exit_type_(EXIT_NORMAL), | 430 last_session_exit_type_(EXIT_NORMAL), |
| 431 start_time_(Time::Now()), | 431 start_time_(Time::Now()), |
| 432 delegate_(delegate), | 432 delegate_(delegate), |
| 433 predictor_(NULL) { | 433 predictor_(NULL) { |
| 434 TRACE_EVENT0("browser,startup", "ProfileImpl::ctor") | 434 TRACE_EVENT0("browser,startup", "ProfileImpl::ctor") |
| 435 DCHECK(!path.empty()) << "Using an empty path will attempt to write " << | 435 DCHECK(!path.empty()) << "Using an empty path will attempt to write " << |
| 436 "profile files to the root directory!"; | 436 "profile files to the root directory!"; |
| 437 | 437 |
| 438 #if defined(OS_CHROMEOS) | 438 #if defined(OS_CHROMEOS) |
| 439 if (!chromeos::ProfileHelper::IsSigninProfile(this)) { | 439 if (!chromeos::ProfileHelper::IsSigninProfile(this) && |
| 440 !chromeos::ProfileHelper::IsLockScreenAppProfile(this)) { |
| 440 const user_manager::User* user = | 441 const user_manager::User* user = |
| 441 chromeos::ProfileHelper::Get()->GetUserByProfile(this); | 442 chromeos::ProfileHelper::Get()->GetUserByProfile(this); |
| 442 // A |User| instance should always exist for a profile which is not the | 443 // A |User| instance should always exist for a profile which is not the |
| 443 // initial or the sign-in profile. | 444 // initial, the sign-in or the lock screen app profile. |
| 444 CHECK(user); | 445 CHECK(user); |
| 445 LOG_IF(FATAL, | 446 LOG_IF(FATAL, |
| 446 !session_manager::SessionManager::Get()->HasSessionForAccountId( | 447 !session_manager::SessionManager::Get()->HasSessionForAccountId( |
| 447 user->GetAccountId())) | 448 user->GetAccountId())) |
| 448 << "Attempting to construct the profile before starting the user " | 449 << "Attempting to construct the profile before starting the user " |
| 449 "session"; | 450 "session"; |
| 450 } | 451 } |
| 451 #endif | 452 #endif |
| 452 | 453 |
| 453 #if BUILDFLAG(ENABLE_SESSION_SERVICE) | 454 #if BUILDFLAG(ENABLE_SESSION_SERVICE) |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 687 | 688 |
| 688 // The DomDistillerViewerSource is not a normal WebUI so it must be registered | 689 // The DomDistillerViewerSource is not a normal WebUI so it must be registered |
| 689 // as a URLDataSource early. | 690 // as a URLDataSource early. |
| 690 dom_distiller::RegisterViewerSource(this); | 691 dom_distiller::RegisterViewerSource(this); |
| 691 | 692 |
| 692 #if defined(OS_CHROMEOS) | 693 #if defined(OS_CHROMEOS) |
| 693 // Finished profile initialization - let the UserManager know so it can | 694 // Finished profile initialization - let the UserManager know so it can |
| 694 // mark the session as initialized. Need to do this before we restart below | 695 // mark the session as initialized. Need to do this before we restart below |
| 695 // so we don't get in a weird state where we restart before the session is | 696 // so we don't get in a weird state where we restart before the session is |
| 696 // marked as initialized and so try to initialize it again. | 697 // marked as initialized and so try to initialize it again. |
| 697 if (!chromeos::ProfileHelper::IsSigninProfile(this)) { | 698 if (!chromeos::ProfileHelper::IsSigninProfile(this) && |
| 699 !chromeos::ProfileHelper::IsLockScreenAppProfile(this)) { |
| 698 chromeos::ProfileHelper* profile_helper = chromeos::ProfileHelper::Get(); | 700 chromeos::ProfileHelper* profile_helper = chromeos::ProfileHelper::Get(); |
| 699 user_manager::UserManager::Get()->OnProfileInitialized( | 701 user_manager::UserManager::Get()->OnProfileInitialized( |
| 700 profile_helper->GetUserByProfile(this)); | 702 profile_helper->GetUserByProfile(this)); |
| 701 } | 703 } |
| 702 | 704 |
| 703 if (chromeos::UserSessionManager::GetInstance() | 705 if (chromeos::UserSessionManager::GetInstance() |
| 704 ->RestartToApplyPerSessionFlagsIfNeed(this, true)) { | 706 ->RestartToApplyPerSessionFlagsIfNeed(this, true)) { |
| 705 return; | 707 return; |
| 706 } | 708 } |
| 707 #endif | 709 #endif |
| (...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1417 | 1419 |
| 1418 std::unique_ptr<service_manager::Service> ProfileImpl::CreateIdentityService() { | 1420 std::unique_ptr<service_manager::Service> ProfileImpl::CreateIdentityService() { |
| 1419 AccountTrackerService* account_tracker = | 1421 AccountTrackerService* account_tracker = |
| 1420 AccountTrackerServiceFactory::GetForProfile(this); | 1422 AccountTrackerServiceFactory::GetForProfile(this); |
| 1421 SigninManagerBase* signin_manager = SigninManagerFactory::GetForProfile(this); | 1423 SigninManagerBase* signin_manager = SigninManagerFactory::GetForProfile(this); |
| 1422 ProfileOAuth2TokenService* token_service = | 1424 ProfileOAuth2TokenService* token_service = |
| 1423 ProfileOAuth2TokenServiceFactory::GetForProfile(this); | 1425 ProfileOAuth2TokenServiceFactory::GetForProfile(this); |
| 1424 return base::MakeUnique<identity::IdentityService>( | 1426 return base::MakeUnique<identity::IdentityService>( |
| 1425 account_tracker, signin_manager, token_service); | 1427 account_tracker, signin_manager, token_service); |
| 1426 } | 1428 } |
| OLD | NEW |