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_manager.h" | 5 #include "chrome/browser/profiles/profile_manager.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 1356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1367 // Record sync stopped by profile destruction if it was on before. | 1367 // Record sync stopped by profile destruction if it was on before. |
| 1368 UMA_HISTOGRAM_ENUMERATION("Sync.StopSource", | 1368 UMA_HISTOGRAM_ENUMERATION("Sync.StopSource", |
| 1369 syncer::PROFILE_DESTRUCTION, | 1369 syncer::PROFILE_DESTRUCTION, |
| 1370 syncer::STOP_SOURCE_LIMIT); | 1370 syncer::STOP_SOURCE_LIMIT); |
| 1371 } | 1371 } |
| 1372 // Ensure data is cleared even if sync was already off. | 1372 // Ensure data is cleared even if sync was already off. |
| 1373 ProfileSyncServiceFactory::GetInstance()->GetForProfile( | 1373 ProfileSyncServiceFactory::GetInstance()->GetForProfile( |
| 1374 profile)->RequestStop(ProfileSyncService::CLEAR_DATA); | 1374 profile)->RequestStop(ProfileSyncService::CLEAR_DATA); |
| 1375 } | 1375 } |
| 1376 | 1376 |
| 1377 ProfileMetrics::LogProfileDelete(cache.ProfileIsAuthenticatedAtIndex( | 1377 size_t profile_index = cache.GetIndexOfProfileWithPath(profile_dir); |
|
anthonyvd
2016/04/12 17:29:16
Can you use the new ProfileAttributesStorage inter
| |
| 1378 cache.GetIndexOfProfileWithPath(profile_dir))); | 1378 if (profile_index != std::string::npos) { |
| 1379 ProfileMetrics::LogProfileDelete( | |
| 1380 cache.ProfileIsAuthenticatedAtIndex(profile_index)); | |
| 1381 } else { | |
| 1382 NOTREACHED(); | |
| 1383 } | |
| 1379 // Some platforms store passwords in keychains. They should be removed. | 1384 // Some platforms store passwords in keychains. They should be removed. |
| 1380 scoped_refptr<password_manager::PasswordStore> password_store = | 1385 scoped_refptr<password_manager::PasswordStore> password_store = |
| 1381 PasswordStoreFactory::GetForProfile( | 1386 PasswordStoreFactory::GetForProfile( |
| 1382 profile, ServiceAccessType::EXPLICIT_ACCESS).get(); | 1387 profile, ServiceAccessType::EXPLICIT_ACCESS).get(); |
| 1383 if (password_store.get()) { | 1388 if (password_store.get()) { |
| 1384 password_store->RemoveLoginsCreatedBetween( | 1389 password_store->RemoveLoginsCreatedBetween( |
| 1385 base::Time(), base::Time::Max(), base::Closure()); | 1390 base::Time(), base::Time::Max(), base::Closure()); |
| 1386 } | 1391 } |
| 1387 | 1392 |
| 1388 // The Profile Data doesn't get wiped until Chrome closes. Since we promised | 1393 // The Profile Data doesn't get wiped until Chrome closes. Since we promised |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1617 | 1622 |
| 1618 FinishDeletingProfile(profile_to_delete_path, new_active_profile_path); | 1623 FinishDeletingProfile(profile_to_delete_path, new_active_profile_path); |
| 1619 if (!original_callback.is_null()) | 1624 if (!original_callback.is_null()) |
| 1620 original_callback.Run(loaded_profile, status); | 1625 original_callback.Run(loaded_profile, status); |
| 1621 } | 1626 } |
| 1622 #endif // !defined(OS_ANDROID) | 1627 #endif // !defined(OS_ANDROID) |
| 1623 | 1628 |
| 1624 ProfileManagerWithoutInit::ProfileManagerWithoutInit( | 1629 ProfileManagerWithoutInit::ProfileManagerWithoutInit( |
| 1625 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { | 1630 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { |
| 1626 } | 1631 } |
| OLD | NEW |