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

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

Issue 2711113003: Track whether a given user session has completed initialization, and use (Closed)
Patch Set: Only expose known_user::RemovePrefsForTesting() for tests Created 3 years, 9 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 626 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 637
638 TRACE_EVENT0("browser", "ProfileImpl::SetSaveSessionStorageOnDisk"); 638 TRACE_EVENT0("browser", "ProfileImpl::SetSaveSessionStorageOnDisk");
639 content::BrowserContext::GetDefaultStoragePartition(this)-> 639 content::BrowserContext::GetDefaultStoragePartition(this)->
640 GetDOMStorageContext()->SetSaveSessionStorageOnDisk(); 640 GetDOMStorageContext()->SetSaveSessionStorageOnDisk();
641 641
642 // The DomDistillerViewerSource is not a normal WebUI so it must be registered 642 // The DomDistillerViewerSource is not a normal WebUI so it must be registered
643 // as a URLDataSource early. 643 // as a URLDataSource early.
644 dom_distiller::RegisterViewerSource(this); 644 dom_distiller::RegisterViewerSource(this);
645 645
646 #if defined(OS_CHROMEOS) 646 #if defined(OS_CHROMEOS)
647 // Finished profile initialization - let the UserManager know so it can
648 // mark the session as initialized. Need to do this before we restart below
649 // so we don't get in a weird state where we restart before the session is
650 // marked as initialized and so try to initialize it again.
651 if (!chromeos::ProfileHelper::IsSigninProfile(this)) {
652 chromeos::ProfileHelper* profile_helper = chromeos::ProfileHelper::Get();
653 user_manager::UserManager::Get()->OnProfileInitialized(
654 profile_helper->GetUserByProfile(this));
655 }
656
647 if (chromeos::UserSessionManager::GetInstance() 657 if (chromeos::UserSessionManager::GetInstance()
648 ->RestartToApplyPerSessionFlagsIfNeed(this, true)) { 658 ->RestartToApplyPerSessionFlagsIfNeed(this, true)) {
649 return; 659 return;
650 } 660 }
651 #endif 661 #endif
652 662
653 if (delegate_) { 663 if (delegate_) {
654 TRACE_EVENT0("browser", "ProfileImpl::DoFileInit:DelegateOnProfileCreated") 664 TRACE_EVENT0("browser", "ProfileImpl::DoFileInit:DelegateOnProfileCreated")
655 delegate_->OnProfileCreated(this, true, IsNewProfile()); 665 delegate_->OnProfileCreated(this, true, IsNewProfile());
656 } 666 }
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after
1292 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { 1302 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) {
1293 domain_reliability::DomainReliabilityService* service = 1303 domain_reliability::DomainReliabilityService* service =
1294 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> 1304 domain_reliability::DomainReliabilityServiceFactory::GetInstance()->
1295 GetForBrowserContext(this); 1305 GetForBrowserContext(this);
1296 if (!service) 1306 if (!service)
1297 return std::unique_ptr<domain_reliability::DomainReliabilityMonitor>(); 1307 return std::unique_ptr<domain_reliability::DomainReliabilityMonitor>();
1298 1308
1299 return service->CreateMonitor( 1309 return service->CreateMonitor(
1300 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); 1310 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO));
1301 } 1311 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_browsertest.cc ('k') | components/user_manager/fake_user_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698