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

Unified Diff: chrome/browser/password_manager/password_store_factory.cc

Issue 999073002: Integrate serving affiliation-based matches into the PasswordStore. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@aff_integration
Patch Set: Reduce scope of CL, test utils are fixed in a separate CL. Created 5 years, 9 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/common/chrome_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/password_manager/password_store_factory.cc
diff --git a/chrome/browser/password_manager/password_store_factory.cc b/chrome/browser/password_manager/password_store_factory.cc
index 29b6b875de8df9c5715d6ff6c62c9b4bb23b6ecd..fba3d006ed0236949734a869026156461846ec26 100644
--- a/chrome/browser/password_manager/password_store_factory.cc
+++ b/chrome/browser/password_manager/password_store_factory.cc
@@ -18,6 +18,9 @@
#include "chrome/common/chrome_switches.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "components/os_crypt/os_crypt_switches.h"
+#include "components/password_manager/core/browser/affiliated_match_helper.h"
+#include "components/password_manager/core/browser/affiliation_service.h"
+#include "components/password_manager/core/browser/affiliation_utils.h"
#include "components/password_manager/core/browser/login_database.h"
#include "components/password_manager/core/browser/password_store.h"
#include "components/password_manager/core/browser/password_store_default.h"
@@ -274,6 +277,24 @@ KeyedService* PasswordStoreFactory::BuildServiceInstanceFor(
return nullptr;
}
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+ if (password_manager::IsAffiliationBasedMatchingEnabled(*command_line)) {
+ // The PasswordStore is so far the only consumer of the AffiliationService,
+ // therefore the service is owned by the AffiliatedMatchHelper, which in
+ // turn is owned by the PasswordStore.
+ // TODO(engedy): Double-check which request context we want.
+ scoped_ptr<password_manager::AffiliationService> affiliation_service(
+ new password_manager::AffiliationService(db_thread_runner));
+ affiliation_service->Initialize(
+ profile->GetRequestContext(),
+ profile->GetPath().Append(chrome::kAffiliationDatabaseFileName));
+ scoped_ptr<password_manager::AffiliatedMatchHelper> affiliated_match_helper(
+ new password_manager::AffiliatedMatchHelper(
+ ps.get(), affiliation_service.Pass()));
+ affiliated_match_helper->Initialize();
+ ps->SetAffiliatedMatchHelper(affiliated_match_helper.Pass());
+ }
+
return new PasswordStoreService(ps);
}
« no previous file with comments | « no previous file | chrome/common/chrome_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698