| 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_manager.h" | 5 #include "chrome/browser/profiles/profile_manager.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 1652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1663 // Do nothing if the profile is already being deleted. | 1663 // Do nothing if the profile is already being deleted. |
| 1664 } else if (profile->GetPrefs()->GetBoolean(prefs::kForceEphemeralProfiles)) { | 1664 } else if (profile->GetPrefs()->GetBoolean(prefs::kForceEphemeralProfiles)) { |
| 1665 // Delete if the profile is an ephemeral profile. | 1665 // Delete if the profile is an ephemeral profile. |
| 1666 g_browser_process->profile_manager()->ScheduleProfileForDeletion( | 1666 g_browser_process->profile_manager()->ScheduleProfileForDeletion( |
| 1667 path, ProfileManager::CreateCallback()); | 1667 path, ProfileManager::CreateCallback()); |
| 1668 } else { | 1668 } else { |
| 1669 #if !defined(OS_ANDROID) && !defined(OS_IOS) && !defined(OS_CHROMEOS) | 1669 #if !defined(OS_ANDROID) && !defined(OS_IOS) && !defined(OS_CHROMEOS) |
| 1670 // Gather statistics and store into ProfileInfoCache. For incognito profile | 1670 // Gather statistics and store into ProfileInfoCache. For incognito profile |
| 1671 // we gather the statistics of its parent profile instead, because a window | 1671 // we gather the statistics of its parent profile instead, because a window |
| 1672 // of the parent profile was open. | 1672 // of the parent profile was open. |
| 1673 if (!profile->IsSystemProfile()) { | 1673 if (!profile->IsSystemProfile() && !original_profile->IsSystemProfile()) { |
| 1674 ProfileStatisticsFactory::GetForProfile(original_profile)-> | 1674 ProfileStatisticsFactory::GetForProfile(original_profile)-> |
| 1675 GatherStatistics(profiles::ProfileStatisticsCallback()); | 1675 GatherStatistics(profiles::ProfileStatisticsCallback()); |
| 1676 } | 1676 } |
| 1677 #endif | 1677 #endif |
| 1678 } | 1678 } |
| 1679 } | 1679 } |
| 1680 | 1680 |
| 1681 void ProfileManager::BrowserListObserver::OnBrowserSetLastActive( | 1681 void ProfileManager::BrowserListObserver::OnBrowserSetLastActive( |
| 1682 Browser* browser) { | 1682 Browser* browser) { |
| 1683 // If all browsers are being closed (e.g. the user is in the process of | 1683 // If all browsers are being closed (e.g. the user is in the process of |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1721 | 1721 |
| 1722 FinishDeletingProfile(profile_to_delete_path, new_active_profile_path); | 1722 FinishDeletingProfile(profile_to_delete_path, new_active_profile_path); |
| 1723 if (!original_callback.is_null()) | 1723 if (!original_callback.is_null()) |
| 1724 original_callback.Run(loaded_profile, status); | 1724 original_callback.Run(loaded_profile, status); |
| 1725 } | 1725 } |
| 1726 #endif // !defined(OS_ANDROID) | 1726 #endif // !defined(OS_ANDROID) |
| 1727 | 1727 |
| 1728 ProfileManagerWithoutInit::ProfileManagerWithoutInit( | 1728 ProfileManagerWithoutInit::ProfileManagerWithoutInit( |
| 1729 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { | 1729 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { |
| 1730 } | 1730 } |
| OLD | NEW |