| 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 <set> | 5 #include <set> |
| 6 | 6 |
| 7 #include "chrome/browser/profiles/profile_manager.h" | 7 #include "chrome/browser/profiles/profile_manager.h" |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 ProfileManager::FindOrCreateNewWindowForProfile( | 152 ProfileManager::FindOrCreateNewWindowForProfile( |
| 153 profile, | 153 profile, |
| 154 BrowserInit::IS_PROCESS_STARTUP, | 154 BrowserInit::IS_PROCESS_STARTUP, |
| 155 BrowserInit::IS_FIRST_RUN, | 155 BrowserInit::IS_FIRST_RUN, |
| 156 false); | 156 false); |
| 157 } | 157 } |
| 158 } | 158 } |
| 159 | 159 |
| 160 } // namespace | 160 } // namespace |
| 161 | 161 |
| 162 #if defined(ENABLE_SESSION_SERVICE) |
| 162 // static | 163 // static |
| 163 void ProfileManager::ShutdownSessionServices() { | 164 void ProfileManager::ShutdownSessionServices() { |
| 164 ProfileManager* pm = g_browser_process->profile_manager(); | 165 ProfileManager* pm = g_browser_process->profile_manager(); |
| 165 if (!pm) // Is NULL when running unit tests. | 166 if (!pm) // Is NULL when running unit tests. |
| 166 return; | 167 return; |
| 167 std::vector<Profile*> profiles(pm->GetLoadedProfiles()); | 168 std::vector<Profile*> profiles(pm->GetLoadedProfiles()); |
| 168 for (size_t i = 0; i < profiles.size(); ++i) | 169 for (size_t i = 0; i < profiles.size(); ++i) |
| 169 SessionServiceFactory::ShutdownForProfile(profiles[i]); | 170 SessionServiceFactory::ShutdownForProfile(profiles[i]); |
| 170 } | 171 } |
| 172 #endif |
| 171 | 173 |
| 172 // static | 174 // static |
| 173 void ProfileManager::NukeDeletedProfilesFromDisk() { | 175 void ProfileManager::NukeDeletedProfilesFromDisk() { |
| 174 for (std::vector<FilePath>::iterator it = | 176 for (std::vector<FilePath>::iterator it = |
| 175 ProfilesToDelete().begin(); | 177 ProfilesToDelete().begin(); |
| 176 it != ProfilesToDelete().end(); | 178 it != ProfilesToDelete().end(); |
| 177 ++it) { | 179 ++it) { |
| 178 // Delete both the profile directory and its corresponding cache. | 180 // Delete both the profile directory and its corresponding cache. |
| 179 FilePath cache_path; | 181 FilePath cache_path; |
| 180 chrome::GetUserCacheDirectory(*it, &cache_path); | 182 chrome::GetUserCacheDirectory(*it, &cache_path); |
| (...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 965 AddProfileToCache(profile); | 967 AddProfileToCache(profile); |
| 966 } | 968 } |
| 967 } | 969 } |
| 968 | 970 |
| 969 void ProfileManager::RunCallbacks(const std::vector<CreateCallback>& callbacks, | 971 void ProfileManager::RunCallbacks(const std::vector<CreateCallback>& callbacks, |
| 970 Profile* profile, | 972 Profile* profile, |
| 971 Profile::CreateStatus status) { | 973 Profile::CreateStatus status) { |
| 972 for (size_t i = 0; i < callbacks.size(); ++i) | 974 for (size_t i = 0; i < callbacks.size(); ++i) |
| 973 callbacks[i].Run(profile, status); | 975 callbacks[i].Run(profile, status); |
| 974 } | 976 } |
| OLD | NEW |