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

Side by Side Diff: chrome/browser/profiles/profile_impl.cc

Issue 2945023002: Introduce profile for lock screen apps (Closed)
Patch Set: . Created 3 years, 6 months 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
OLDNEW
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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 io_data_(this), 428 io_data_(this),
429 last_session_exit_type_(EXIT_NORMAL), 429 last_session_exit_type_(EXIT_NORMAL),
430 start_time_(Time::Now()), 430 start_time_(Time::Now()),
431 delegate_(delegate), 431 delegate_(delegate),
432 predictor_(NULL) { 432 predictor_(NULL) {
433 TRACE_EVENT0("browser,startup", "ProfileImpl::ctor") 433 TRACE_EVENT0("browser,startup", "ProfileImpl::ctor")
434 DCHECK(!path.empty()) << "Using an empty path will attempt to write " << 434 DCHECK(!path.empty()) << "Using an empty path will attempt to write " <<
435 "profile files to the root directory!"; 435 "profile files to the root directory!";
436 436
437 #if defined(OS_CHROMEOS) 437 #if defined(OS_CHROMEOS)
438 if (!chromeos::ProfileHelper::IsSigninProfile(this)) { 438 if (!chromeos::ProfileHelper::IsSigninProfile(this) &&
439 !chromeos::ProfileHelper::IsLockScreenAppProfile(this)) {
439 const user_manager::User* user = 440 const user_manager::User* user =
440 chromeos::ProfileHelper::Get()->GetUserByProfile(this); 441 chromeos::ProfileHelper::Get()->GetUserByProfile(this);
441 // A |User| instance should always exist for a profile which is not the 442 // A |User| instance should always exist for a profile which is not the
442 // initial or the sign-in profile. 443 // initial or the sign-in profile.
emaxx 2017/06/23 16:16:30 nit: Update the comment too?
tbarzic 2017/06/23 17:18:40 Done.
443 CHECK(user); 444 CHECK(user);
444 LOG_IF(FATAL, 445 LOG_IF(FATAL,
445 !session_manager::SessionManager::Get()->HasSessionForAccountId( 446 !session_manager::SessionManager::Get()->HasSessionForAccountId(
446 user->GetAccountId())) 447 user->GetAccountId()))
447 << "Attempting to construct the profile before starting the user " 448 << "Attempting to construct the profile before starting the user "
448 "session"; 449 "session";
449 } 450 }
450 #endif 451 #endif
451 452
452 #if BUILDFLAG(ENABLE_SESSION_SERVICE) 453 #if BUILDFLAG(ENABLE_SESSION_SERVICE)
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
686 687
687 // The DomDistillerViewerSource is not a normal WebUI so it must be registered 688 // The DomDistillerViewerSource is not a normal WebUI so it must be registered
688 // as a URLDataSource early. 689 // as a URLDataSource early.
689 dom_distiller::RegisterViewerSource(this); 690 dom_distiller::RegisterViewerSource(this);
690 691
691 #if defined(OS_CHROMEOS) 692 #if defined(OS_CHROMEOS)
692 // Finished profile initialization - let the UserManager know so it can 693 // Finished profile initialization - let the UserManager know so it can
693 // mark the session as initialized. Need to do this before we restart below 694 // mark the session as initialized. Need to do this before we restart below
694 // so we don't get in a weird state where we restart before the session is 695 // so we don't get in a weird state where we restart before the session is
695 // marked as initialized and so try to initialize it again. 696 // marked as initialized and so try to initialize it again.
696 if (!chromeos::ProfileHelper::IsSigninProfile(this)) { 697 if (!chromeos::ProfileHelper::IsSigninProfile(this) &&
698 !chromeos::ProfileHelper::IsLockScreenAppProfile(this)) {
697 chromeos::ProfileHelper* profile_helper = chromeos::ProfileHelper::Get(); 699 chromeos::ProfileHelper* profile_helper = chromeos::ProfileHelper::Get();
698 user_manager::UserManager::Get()->OnProfileInitialized( 700 user_manager::UserManager::Get()->OnProfileInitialized(
699 profile_helper->GetUserByProfile(this)); 701 profile_helper->GetUserByProfile(this));
700 } 702 }
701 703
702 if (chromeos::UserSessionManager::GetInstance() 704 if (chromeos::UserSessionManager::GetInstance()
703 ->RestartToApplyPerSessionFlagsIfNeed(this, true)) { 705 ->RestartToApplyPerSessionFlagsIfNeed(this, true)) {
704 return; 706 return;
705 } 707 }
706 #endif 708 #endif
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after
1414 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); 1416 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO));
1415 } 1417 }
1416 1418
1417 std::unique_ptr<service_manager::Service> ProfileImpl::CreateIdentityService() { 1419 std::unique_ptr<service_manager::Service> ProfileImpl::CreateIdentityService() {
1418 SigninManagerBase* signin_manager = SigninManagerFactory::GetForProfile(this); 1420 SigninManagerBase* signin_manager = SigninManagerFactory::GetForProfile(this);
1419 ProfileOAuth2TokenService* token_service = 1421 ProfileOAuth2TokenService* token_service =
1420 ProfileOAuth2TokenServiceFactory::GetForProfile(this); 1422 ProfileOAuth2TokenServiceFactory::GetForProfile(this);
1421 return base::MakeUnique<identity::IdentityService>(signin_manager, 1423 return base::MakeUnique<identity::IdentityService>(signin_manager,
1422 token_service); 1424 token_service);
1423 } 1425 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698