| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/password_manager/core/browser/password_store_factory_util.h
" | 5 #include "components/password_manager/core/browser/password_store_factory_util.h
" |
| 6 | 6 |
| 7 #include <utility> |
| 8 |
| 7 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 8 #include "components/password_manager/core/browser/affiliated_match_helper.h" | 10 #include "components/password_manager/core/browser/affiliated_match_helper.h" |
| 9 #include "components/password_manager/core/browser/affiliation_service.h" | 11 #include "components/password_manager/core/browser/affiliation_service.h" |
| 10 #include "components/password_manager/core/browser/affiliation_utils.h" | 12 #include "components/password_manager/core/browser/affiliation_utils.h" |
| 11 #include "components/password_manager/core/browser/password_manager_constants.h" | 13 #include "components/password_manager/core/browser/password_manager_constants.h" |
| 12 | 14 |
| 13 namespace password_manager { | 15 namespace password_manager { |
| 14 | 16 |
| 15 namespace { | 17 namespace { |
| 16 | 18 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 31 net::URLRequestContextGetter* request_context_getter, | 33 net::URLRequestContextGetter* request_context_getter, |
| 32 const base::FilePath& db_path, | 34 const base::FilePath& db_path, |
| 33 scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner) { | 35 scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner) { |
| 34 // The PasswordStore is so far the only consumer of the AffiliationService, | 36 // The PasswordStore is so far the only consumer of the AffiliationService, |
| 35 // therefore the service is owned by the AffiliatedMatchHelper, which in | 37 // therefore the service is owned by the AffiliatedMatchHelper, which in |
| 36 // turn is owned by the PasswordStore. | 38 // turn is owned by the PasswordStore. |
| 37 scoped_ptr<AffiliationService> affiliation_service( | 39 scoped_ptr<AffiliationService> affiliation_service( |
| 38 new AffiliationService(db_thread_runner)); | 40 new AffiliationService(db_thread_runner)); |
| 39 affiliation_service->Initialize(request_context_getter, db_path); | 41 affiliation_service->Initialize(request_context_getter, db_path); |
| 40 scoped_ptr<AffiliatedMatchHelper> affiliated_match_helper( | 42 scoped_ptr<AffiliatedMatchHelper> affiliated_match_helper( |
| 41 new AffiliatedMatchHelper(password_store, affiliation_service.Pass())); | 43 new AffiliatedMatchHelper(password_store, |
| 44 std::move(affiliation_service))); |
| 42 affiliated_match_helper->Initialize(); | 45 affiliated_match_helper->Initialize(); |
| 43 password_store->SetAffiliatedMatchHelper(affiliated_match_helper.Pass()); | 46 password_store->SetAffiliatedMatchHelper(std::move(affiliated_match_helper)); |
| 44 | 47 |
| 45 password_store->enable_propagating_password_changes_to_web_credentials( | 48 password_store->enable_propagating_password_changes_to_web_credentials( |
| 46 IsPropagatingPasswordChangesToWebCredentialsEnabled( | 49 IsPropagatingPasswordChangesToWebCredentialsEnabled( |
| 47 *base::CommandLine::ForCurrentProcess())); | 50 *base::CommandLine::ForCurrentProcess())); |
| 48 } | 51 } |
| 49 | 52 |
| 50 base::FilePath GetAffiliationDatabasePath(const base::FilePath& profile_path) { | 53 base::FilePath GetAffiliationDatabasePath(const base::FilePath& profile_path) { |
| 51 return profile_path.Append(kAffiliationDatabaseFileName); | 54 return profile_path.Append(kAffiliationDatabaseFileName); |
| 52 } | 55 } |
| 53 | 56 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 } | 91 } |
| 89 } | 92 } |
| 90 | 93 |
| 91 scoped_ptr<LoginDatabase> CreateLoginDatabase( | 94 scoped_ptr<LoginDatabase> CreateLoginDatabase( |
| 92 const base::FilePath& profile_path) { | 95 const base::FilePath& profile_path) { |
| 93 base::FilePath login_db_file_path = profile_path.Append(kLoginDataFileName); | 96 base::FilePath login_db_file_path = profile_path.Append(kLoginDataFileName); |
| 94 return make_scoped_ptr(new LoginDatabase(login_db_file_path)); | 97 return make_scoped_ptr(new LoginDatabase(login_db_file_path)); |
| 95 } | 98 } |
| 96 | 99 |
| 97 } // namespace password_manager | 100 } // namespace password_manager |
| OLD | NEW |