| 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 #ifndef COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_SYNC_CREDENTIALS_FILTER_H_ | 5 #ifndef COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_SYNC_CREDENTIALS_FILTER_H_ |
| 6 #define COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_SYNC_CREDENTIALS_FILTER_H_ | 6 #define COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_SYNC_CREDENTIALS_FILTER_H_ |
| 7 | 7 |
| 8 #include <memory> | |
| 9 #include <string> | 8 #include <string> |
| 10 #include <vector> | |
| 11 | 9 |
| 12 #include "base/callback.h" | 10 #include "base/callback.h" |
| 13 #include "base/macros.h" | 11 #include "base/macros.h" |
| 14 #include "components/autofill/core/common/password_form.h" | 12 #include "components/autofill/core/common/password_form.h" |
| 15 #include "components/password_manager/core/browser/credentials_filter.h" | 13 #include "components/password_manager/core/browser/credentials_filter.h" |
| 16 #include "components/password_manager/core/browser/password_manager_client.h" | 14 #include "components/password_manager/core/browser/password_manager_client.h" |
| 17 #include "components/signin/core/browser/signin_manager.h" | 15 #include "components/signin/core/browser/signin_manager.h" |
| 18 #include "components/sync/driver/sync_service.h" | 16 #include "components/sync/driver/sync_service.h" |
| 19 | 17 |
| 20 namespace password_manager { | 18 namespace password_manager { |
| 21 | 19 |
| 22 // The sync- and GAIA- aware implementation of the filter. | 20 // The sync- and GAIA- aware implementation of the filter. |
| 23 class SyncCredentialsFilter : public CredentialsFilter { | 21 class SyncCredentialsFilter : public CredentialsFilter { |
| 24 public: | 22 public: |
| 25 typedef base::Callback<const syncer::SyncService*(void)> | 23 typedef base::Callback<const sync_driver::SyncService*(void)> |
| 26 SyncServiceFactoryFunction; | 24 SyncServiceFactoryFunction; |
| 27 typedef base::Callback<const SigninManagerBase*(void)> | 25 typedef base::Callback<const SigninManagerBase*(void)> |
| 28 SigninManagerFactoryFunction; | 26 SigninManagerFactoryFunction; |
| 29 | 27 |
| 30 // Implements protection of sync credentials. Uses |client| to get the last | 28 // Implements protection of sync credentials. Uses |client| to get the last |
| 31 // commited entry URL for a check against GAIA reauth site. Uses the factory | 29 // commited entry URL for a check against GAIA reauth site. Uses the factory |
| 32 // functions repeatedly to get the sync service and signin manager to pass | 30 // functions repeatedly to get the sync service and signin manager to pass |
| 33 // them to sync_util methods. | 31 // them to sync_util methods. |
| 34 // TODO(vabr): Could we safely just get a pointer to the services for the | 32 // TODO(vabr): Could we safely just get a pointer to the services for the |
| 35 // lifetime of the filter? | 33 // lifetime of the filter? |
| (...skipping 26 matching lines...) Expand all Loading... |
| 62 const SyncServiceFactoryFunction sync_service_factory_function_; | 60 const SyncServiceFactoryFunction sync_service_factory_function_; |
| 63 | 61 |
| 64 const SigninManagerFactoryFunction signin_manager_factory_function_; | 62 const SigninManagerFactoryFunction signin_manager_factory_function_; |
| 65 | 63 |
| 66 DISALLOW_COPY_AND_ASSIGN(SyncCredentialsFilter); | 64 DISALLOW_COPY_AND_ASSIGN(SyncCredentialsFilter); |
| 67 }; | 65 }; |
| 68 | 66 |
| 69 } // namespace password_manager | 67 } // namespace password_manager |
| 70 | 68 |
| 71 #endif // COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_SYNC_CREDENTIALS_FILTER_H_ | 69 #endif // COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_SYNC_CREDENTIALS_FILTER_H_ |
| OLD | NEW |