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 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
844 | 844 |
845 void ProfileImpl::OnPrefsLoaded(bool success) { | 845 void ProfileImpl::OnPrefsLoaded(bool success) { |
846 TRACE_EVENT0("browser", "ProfileImpl::OnPrefsLoaded"); | 846 TRACE_EVENT0("browser", "ProfileImpl::OnPrefsLoaded"); |
847 SCOPED_UMA_HISTOGRAM_TIMER("Profile.OnPrefsLoadedTime"); | 847 SCOPED_UMA_HISTOGRAM_TIMER("Profile.OnPrefsLoadedTime"); |
848 if (!success) { | 848 if (!success) { |
849 if (delegate_) | 849 if (delegate_) |
850 delegate_->OnProfileCreated(this, false, false); | 850 delegate_->OnProfileCreated(this, false, false); |
851 return; | 851 return; |
852 } | 852 } |
853 | 853 |
854 // TODO(mirandac): remove migration code after 6 months (crbug.com/69995). | 854 // Migrate obsolete prefs. |
855 if (g_browser_process->local_state()) | 855 if (g_browser_process->local_state()) |
856 chrome::MigrateBrowserPrefs(this, g_browser_process->local_state()); | 856 chrome::MigrateObsoleteBrowserPrefs(this, g_browser_process->local_state()); |
857 // TODO(ivankr): remove cleanup code eventually (crbug.com/165672). | 857 chrome::MigrateObsoleteProfilePrefs(this); |
858 chrome::MigrateUserPrefs(this); | |
859 | 858 |
860 // |kSessionExitType| was added after |kSessionExitedCleanly|. If the pref | 859 // |kSessionExitType| was added after |kSessionExitedCleanly|. If the pref |
861 // value is empty fallback to checking for |kSessionExitedCleanly|. | 860 // value is empty fallback to checking for |kSessionExitedCleanly|. |
862 const std::string exit_type_pref_value( | 861 const std::string exit_type_pref_value( |
863 prefs_->GetString(prefs::kSessionExitType)); | 862 prefs_->GetString(prefs::kSessionExitType)); |
864 if (exit_type_pref_value.empty()) { | 863 if (exit_type_pref_value.empty()) { |
865 last_session_exit_type_ = | 864 last_session_exit_type_ = |
866 prefs_->GetBoolean(prefs::kSessionExitedCleanly) ? | 865 prefs_->GetBoolean(prefs::kSessionExitedCleanly) ? |
867 EXIT_NORMAL : EXIT_CRASHED; | 866 EXIT_NORMAL : EXIT_CRASHED; |
868 } else { | 867 } else { |
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1324 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { | 1323 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { |
1325 domain_reliability::DomainReliabilityService* service = | 1324 domain_reliability::DomainReliabilityService* service = |
1326 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> | 1325 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> |
1327 GetForBrowserContext(this); | 1326 GetForBrowserContext(this); |
1328 if (!service) | 1327 if (!service) |
1329 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); | 1328 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); |
1330 | 1329 |
1331 return service->CreateMonitor( | 1330 return service->CreateMonitor( |
1332 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); | 1331 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); |
1333 } | 1332 } |
OLD | NEW |