Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(205)

Unified Diff: chrome/browser/profiles/profile_manager.cc

Issue 363013003: Remove passwords from the keychain if the profile is destroyed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: The new comment Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_manager_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_manager.cc
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc
index 845f33c818d4799b1e575f41689c06cb69a45972..686e3025bf084cab2548364a9e2071f5b20296e1 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -25,6 +25,7 @@
#include "chrome/browser/content_settings/host_content_settings_map.h"
#include "chrome/browser/download/download_service.h"
#include "chrome/browser/download/download_service_factory.h"
+#include "chrome/browser/password_manager/password_store_factory.h"
#include "chrome/browser/prefs/incognito_mode_prefs.h"
#include "chrome/browser/profiles/bookmark_model_loaded_observer.h"
#include "chrome/browser/profiles/profile_avatar_icon_util.h"
@@ -47,6 +48,7 @@
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "components/bookmarks/browser/bookmark_model.h"
+#include "components/password_manager/core/browser/password_store.h"
#include "components/signin/core/common/profile_management_switches.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
@@ -1108,6 +1110,14 @@ void ProfileManager::FinishDeletingProfile(const base::FilePath& profile_dir) {
bool profile_is_signed_in = !cache.GetUserNameOfProfileAtIndex(
cache.GetIndexOfProfileWithPath(profile_dir)).empty();
ProfileMetrics::LogProfileDelete(profile_is_signed_in);
+ // Some platforms store passwords in keychains. They should be removed.
+ scoped_refptr<password_manager::PasswordStore> password_store =
+ PasswordStoreFactory::GetForProfile(profile, Profile::EXPLICIT_ACCESS)
+ .get();
+ if (password_store) {
+ password_store->RemoveLoginsCreatedBetween(base::Time(),
+ base::Time::Max());
+ }
}
QueueProfileDirectoryForDeletion(profile_dir);
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_manager_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698