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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
504 prefs_->AddPrefInitObserver(base::Bind(&ProfileImpl::OnPrefsLoaded, | 504 prefs_->AddPrefInitObserver(base::Bind(&ProfileImpl::OnPrefsLoaded, |
505 base::Unretained(this))); | 505 base::Unretained(this))); |
506 } else { | 506 } else { |
507 // Prefs were loaded synchronously so we can continue directly. | 507 // Prefs were loaded synchronously so we can continue directly. |
508 OnPrefsLoaded(true); | 508 OnPrefsLoaded(true); |
509 } | 509 } |
510 } | 510 } |
511 | 511 |
512 void ProfileImpl::DoFinalInit() { | 512 void ProfileImpl::DoFinalInit() { |
513 TRACE_EVENT0("browser", "ProfileImpl::DoFinalInit") | 513 TRACE_EVENT0("browser", "ProfileImpl::DoFinalInit") |
514 DCHECK_CURRENTLY_ON(BrowserThread::UI); | |
514 PrefService* prefs = GetPrefs(); | 515 PrefService* prefs = GetPrefs(); |
515 pref_change_registrar_.Init(prefs); | 516 pref_change_registrar_.Init(prefs); |
516 pref_change_registrar_.Add( | 517 pref_change_registrar_.Add( |
517 prefs::kGoogleServicesUsername, | 518 prefs::kGoogleServicesUsername, |
518 base::Bind(&ProfileImpl::UpdateProfileUserNameCache, | 519 base::Bind(&ProfileImpl::UpdateProfileUserNameCache, |
519 base::Unretained(this))); | 520 base::Unretained(this))); |
520 pref_change_registrar_.Add( | 521 pref_change_registrar_.Add( |
521 prefs::kSupervisedUserId, | 522 prefs::kSupervisedUserId, |
522 base::Bind(&ProfileImpl::UpdateProfileSupervisedUserIdCache, | 523 base::Bind(&ProfileImpl::UpdateProfileSupervisedUserIdCache, |
523 base::Unretained(this))); | 524 base::Unretained(this))); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
624 #endif | 625 #endif |
625 content::CookieStoreConfig::SessionCookieMode session_cookie_mode = | 626 content::CookieStoreConfig::SessionCookieMode session_cookie_mode = |
626 content::CookieStoreConfig::PERSISTANT_SESSION_COOKIES; | 627 content::CookieStoreConfig::PERSISTANT_SESSION_COOKIES; |
627 if (GetLastSessionExitType() == Profile::EXIT_CRASHED || | 628 if (GetLastSessionExitType() == Profile::EXIT_CRASHED || |
628 startup_pref_type == SessionStartupPref::LAST) { | 629 startup_pref_type == SessionStartupPref::LAST) { |
629 session_cookie_mode = content::CookieStoreConfig::RESTORED_SESSION_COOKIES; | 630 session_cookie_mode = content::CookieStoreConfig::RESTORED_SESSION_COOKIES; |
630 } | 631 } |
631 | 632 |
632 InitHostZoomMap(); | 633 InitHostZoomMap(); |
633 | 634 |
635 // Make sure HostContentSettingsMap is created on the UI thread. | |
vabr (Chromium)
2014/10/01 11:14:48
This only really makes sure that HCSM is created o
vabr (Chromium)
2014/10/01 11:14:48
Also, should chrome/test/base/testing_profile.cc g
Bernhard Bauer
2014/10/01 11:41:09
Really, if we have a defined place where we constr
Jun Mukai
2014/10/14 23:53:13
Indeed, I was confused previously but we can add D
| |
636 GetHostContentSettingsMap(); | |
637 | |
634 base::Callback<void(bool)> data_reduction_proxy_unavailable; | 638 base::Callback<void(bool)> data_reduction_proxy_unavailable; |
635 scoped_ptr<data_reduction_proxy::DataReductionProxyParams> | 639 scoped_ptr<data_reduction_proxy::DataReductionProxyParams> |
636 data_reduction_proxy_params; | 640 data_reduction_proxy_params; |
637 scoped_ptr<DataReductionProxyChromeConfigurator> chrome_configurator; | 641 scoped_ptr<DataReductionProxyChromeConfigurator> chrome_configurator; |
638 scoped_ptr<data_reduction_proxy::DataReductionProxyStatisticsPrefs> | 642 scoped_ptr<data_reduction_proxy::DataReductionProxyStatisticsPrefs> |
639 data_reduction_proxy_statistics_prefs; | 643 data_reduction_proxy_statistics_prefs; |
640 DataReductionProxyChromeSettings* data_reduction_proxy_chrome_settings = | 644 DataReductionProxyChromeSettings* data_reduction_proxy_chrome_settings = |
641 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(this); | 645 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(this); |
642 data_reduction_proxy_params = | 646 data_reduction_proxy_params = |
643 data_reduction_proxy_chrome_settings->params()->Clone(); | 647 data_reduction_proxy_chrome_settings->params()->Clone(); |
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1435 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> | 1439 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> |
1436 GetForBrowserContext(this); | 1440 GetForBrowserContext(this); |
1437 if (!service) | 1441 if (!service) |
1438 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); | 1442 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); |
1439 | 1443 |
1440 return service->CreateMonitor( | 1444 return service->CreateMonitor( |
1441 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), | 1445 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), |
1442 local_state, | 1446 local_state, |
1443 prefs::kMetricsReportingEnabled); | 1447 prefs::kMetricsReportingEnabled); |
1444 } | 1448 } |
OLD | NEW |