Chromium Code Reviews| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 726 } else { | 726 } else { |
| 727 last_session_exit_type_ = | 727 last_session_exit_type_ = |
| 728 SessionTypePrefValueToExitType(exit_type_pref_value); | 728 SessionTypePrefValueToExitType(exit_type_pref_value); |
| 729 } | 729 } |
| 730 // Mark the session as open. | 730 // Mark the session as open. |
| 731 prefs_->SetString(prefs::kSessionExitType, kPrefExitTypeCrashed); | 731 prefs_->SetString(prefs::kSessionExitType, kPrefExitTypeCrashed); |
| 732 // Force this to true in case we fallback and use it. | 732 // Force this to true in case we fallback and use it. |
| 733 // TODO(sky): remove this in a couple of releases (m28ish). | 733 // TODO(sky): remove this in a couple of releases (m28ish). |
| 734 prefs_->SetBoolean(prefs::kSessionExitedCleanly, true); | 734 prefs_->SetBoolean(prefs::kSessionExitedCleanly, true); |
| 735 | 735 |
| 736 #if defined(OS_WIN) | |
| 737 if (!prefs_->GetBoolean(prefs::kProfileIconCreated)) { | |
| 738 // Ensure the profile's icon file has been created. | |
|
Alexei Svitkine (slow)
2013/05/24 14:43:51
Nit: Indent 2 more.
calamity
2013/05/31 04:07:27
Done.
| |
| 739 ProfileShortcutManager* profile_shortcut_manager = | |
| 740 g_browser_process->profile_manager()->profile_shortcut_manager(); | |
| 741 if (profile_shortcut_manager) { | |
| 742 profile_shortcut_manager->CreateProfileIcon(GetPath()); | |
| 743 prefs_->SetBoolean(prefs::kProfileIconCreated, true); | |
|
Alexei Svitkine (slow)
2013/05/24 14:43:51
I would still like to have this pref set only afte
calamity
2013/05/31 04:07:27
I'm a little hesitant to do this if the name is go
Alexei Svitkine (slow)
2013/05/31 13:48:38
I'm okay with the having the callback exposed too.
calamity
2013/06/04 01:24:57
Done.
| |
| 744 } | |
| 745 } | |
| 746 #endif | |
| 747 | |
| 736 ProfileDependencyManager::GetInstance()->CreateProfileServices(this, false); | 748 ProfileDependencyManager::GetInstance()->CreateProfileServices(this, false); |
| 737 | 749 |
| 738 DCHECK(!net_pref_observer_); | 750 DCHECK(!net_pref_observer_); |
| 739 net_pref_observer_.reset(new NetPrefObserver( | 751 net_pref_observer_.reset(new NetPrefObserver( |
| 740 prefs_.get(), | 752 prefs_.get(), |
| 741 prerender::PrerenderManagerFactory::GetForProfile(this), | 753 prerender::PrerenderManagerFactory::GetForProfile(this), |
| 742 predictor_)); | 754 predictor_)); |
| 743 | 755 |
| 744 ChromeVersionService::OnProfileLoaded(prefs_.get(), IsNewProfile()); | 756 ChromeVersionService::OnProfileLoaded(prefs_.get(), IsNewProfile()); |
| 745 DoFinalInit(); | 757 DoFinalInit(); |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1135 base::FilePath* cache_path, | 1147 base::FilePath* cache_path, |
| 1136 int* max_size) { | 1148 int* max_size) { |
| 1137 DCHECK(cache_path); | 1149 DCHECK(cache_path); |
| 1138 DCHECK(max_size); | 1150 DCHECK(max_size); |
| 1139 base::FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); | 1151 base::FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); |
| 1140 if (!path.empty()) | 1152 if (!path.empty()) |
| 1141 *cache_path = path; | 1153 *cache_path = path; |
| 1142 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : | 1154 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : |
| 1143 prefs_->GetInteger(prefs::kDiskCacheSize); | 1155 prefs_->GetInteger(prefs::kDiskCacheSize); |
| 1144 } | 1156 } |
| OLD | NEW |