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 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 742 } else { | 742 } else { | 
| 743 last_session_exit_type_ = | 743 last_session_exit_type_ = | 
| 744 SessionTypePrefValueToExitType(exit_type_pref_value); | 744 SessionTypePrefValueToExitType(exit_type_pref_value); | 
| 745 } | 745 } | 
| 746 // Mark the session as open. | 746 // Mark the session as open. | 
| 747 prefs_->SetString(prefs::kSessionExitType, kPrefExitTypeCrashed); | 747 prefs_->SetString(prefs::kSessionExitType, kPrefExitTypeCrashed); | 
| 748 // Force this to true in case we fallback and use it. | 748 // Force this to true in case we fallback and use it. | 
| 749 // TODO(sky): remove this in a couple of releases (m28ish). | 749 // TODO(sky): remove this in a couple of releases (m28ish). | 
| 750 prefs_->SetBoolean(prefs::kSessionExitedCleanly, true); | 750 prefs_->SetBoolean(prefs::kSessionExitedCleanly, true); | 
| 751 | 751 | 
| 752 #if defined(OS_WIN) | |
| 753 // Ensure the profile's icon file has been created. | |
| 754 if (!prefs_->GetBoolean(prefs::kProfileIconCreated)) { | |
| 755 ProfileShortcutManager* profile_shortcut_manager = | |
| 756 g_browser_process->profile_manager()->profile_shortcut_manager(); | |
| 757 profile_shortcut_manager->CreateProfileIcon(GetPath()); | |
| 
 
Alexei Svitkine (slow)
2013/05/03 17:20:47
Please check that profile_shorcut_manager is not N
 
gab
2013/05/07 12:38:39
So this means that profile taskbar icons (pinned o
 
calamity
2013/05/08 08:15:42
Hmm. I hadn't realized that this could be a proble
 
gab
2013/05/08 13:01:08
Even if we remove app_list from the condition, I'm
 
Alexei Svitkine (slow)
2013/05/08 15:12:04
I wrote a CL to implement this in: https://coderev
 
Alexei Svitkine (slow)
2013/05/08 15:12:04
We could make CreateOrUpdateShortcutsForProfileAtP
 
calamity
2013/05/09 06:12:16
There are only a few callers. I'll just set it to
 
gab
2013/05/09 13:43:56
I see, so as it is now we only use this icon for s
 
gab
2013/05/09 13:43:56
I'm not sure what you mean here, if you always cre
 
 | |
| 758 prefs_->SetBoolean(prefs::kProfileIconCreated, true); | |
| 
 
Alexei Svitkine (slow)
2013/05/03 17:20:47
I think this should be set in a callback as a resu
 
calamity
2013/05/08 08:15:42
We won't need this pref if we are checking the pro
 
gab
2013/05/08 13:01:08
Haven't looked deeply in the pref part of this, bu
 
calamity
2013/05/09 06:12:16
The pref is a "on first run past this change" pref
 
 | |
| 759 } | |
| 760 #endif | |
| 761 | |
| 752 ProfileDependencyManager::GetInstance()->CreateProfileServices(this, false); | 762 ProfileDependencyManager::GetInstance()->CreateProfileServices(this, false); | 
| 753 | 763 | 
| 754 DCHECK(!net_pref_observer_.get()); | 764 DCHECK(!net_pref_observer_.get()); | 
| 755 net_pref_observer_.reset(new NetPrefObserver( | 765 net_pref_observer_.reset(new NetPrefObserver( | 
| 756 prefs_.get(), | 766 prefs_.get(), | 
| 757 prerender::PrerenderManagerFactory::GetForProfile(this), | 767 prerender::PrerenderManagerFactory::GetForProfile(this), | 
| 758 predictor_)); | 768 predictor_)); | 
| 759 | 769 | 
| 760 ChromeVersionService::OnProfileLoaded(prefs_.get(), IsNewProfile()); | 770 ChromeVersionService::OnProfileLoaded(prefs_.get(), IsNewProfile()); | 
| 761 DoFinalInit(); | 771 DoFinalInit(); | 
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1164 base::FilePath* cache_path, | 1174 base::FilePath* cache_path, | 
| 1165 int* max_size) { | 1175 int* max_size) { | 
| 1166 DCHECK(cache_path); | 1176 DCHECK(cache_path); | 
| 1167 DCHECK(max_size); | 1177 DCHECK(max_size); | 
| 1168 base::FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); | 1178 base::FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); | 
| 1169 if (!path.empty()) | 1179 if (!path.empty()) | 
| 1170 *cache_path = path; | 1180 *cache_path = path; | 
| 1171 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : | 1181 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : | 
| 1172 prefs_->GetInteger(prefs::kDiskCacheSize); | 1182 prefs_->GetInteger(prefs::kDiskCacheSize); | 
| 1173 } | 1183 } | 
| OLD | NEW |