| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/profile_manager.h" | 7 #include "chrome/browser/profile_manager.h" |
| 8 | 8 |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 } | 35 } |
| 36 | 36 |
| 37 // static | 37 // static |
| 38 void ProfileManager::ShutdownSessionServices() { | 38 void ProfileManager::ShutdownSessionServices() { |
| 39 ProfileManager* pm = g_browser_process->profile_manager(); | 39 ProfileManager* pm = g_browser_process->profile_manager(); |
| 40 for (ProfileManager::const_iterator i = pm->begin(); i != pm->end(); ++i) | 40 for (ProfileManager::const_iterator i = pm->begin(); i != pm->end(); ++i) |
| 41 (*i)->ShutdownSessionService(); | 41 (*i)->ShutdownSessionService(); |
| 42 } | 42 } |
| 43 | 43 |
| 44 ProfileManager::ProfileManager() { | 44 ProfileManager::ProfileManager() { |
| 45 base::SystemMonitor::Get()->AddObserver(this); | 45 SystemMonitor::Get()->AddObserver(this); |
| 46 } | 46 } |
| 47 | 47 |
| 48 ProfileManager::~ProfileManager() { | 48 ProfileManager::~ProfileManager() { |
| 49 base::SystemMonitor* system_monitor = base::SystemMonitor::Get(); | 49 SystemMonitor* system_monitor = SystemMonitor::Get(); |
| 50 if (system_monitor) | 50 if (system_monitor) |
| 51 system_monitor->RemoveObserver(this); | 51 system_monitor->RemoveObserver(this); |
| 52 | 52 |
| 53 // Destroy all profiles that we're keeping track of. | 53 // Destroy all profiles that we're keeping track of. |
| 54 for (const_iterator i(begin()); i != end(); ++i) | 54 for (const_iterator i(begin()); i != end(); ++i) |
| 55 delete *i; | 55 delete *i; |
| 56 profiles_.clear(); | 56 profiles_.clear(); |
| 57 | 57 |
| 58 // Get rid of available profile list | 58 // Get rid of available profile list |
| 59 for (AvailableProfileVector::const_iterator i(available_profiles_.begin()); | 59 for (AvailableProfileVector::const_iterator i(available_profiles_.begin()); |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 | 312 |
| 313 return profile; | 313 return profile; |
| 314 } | 314 } |
| 315 | 315 |
| 316 // static | 316 // static |
| 317 std::wstring ProfileManager::CanonicalizeID(const std::wstring& id) { | 317 std::wstring ProfileManager::CanonicalizeID(const std::wstring& id) { |
| 318 std::wstring no_whitespace; | 318 std::wstring no_whitespace; |
| 319 TrimWhitespace(id, TRIM_ALL, &no_whitespace); | 319 TrimWhitespace(id, TRIM_ALL, &no_whitespace); |
| 320 return StringToLowerASCII(no_whitespace); | 320 return StringToLowerASCII(no_whitespace); |
| 321 } | 321 } |
| OLD | NEW |