Commit 25a76093 authored by Jan Wilken Dörrie's avatar Jan Wilken Dörrie Committed by Commit Bot

[Passwords] PasswordForm in //chrome/browser/android

This change drops usages of autofill::PasswordForm in //c/b/android in
favor of password_manager::PasswordForm.

TBR=mamir

Bug: 1067347
Change-Id: I76d503a30aac561a633f17c2925c56335abd1df9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2445269
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: default avatarMohamed Amir Yosef <mamir@chromium.org>
Cr-Commit-Position: refs/heads/master@{#813149}
parent b400a21e
...@@ -11,7 +11,8 @@ ...@@ -11,7 +11,8 @@
PasswordEditDelegateSettingsImpl::PasswordEditDelegateSettingsImpl( PasswordEditDelegateSettingsImpl::PasswordEditDelegateSettingsImpl(
Profile* profile, Profile* profile,
base::span<const std::unique_ptr<autofill::PasswordForm>> forms_to_change, base::span<const std::unique_ptr<password_manager::PasswordForm>>
forms_to_change,
std::vector<base::string16> existing_usernames) std::vector<base::string16> existing_usernames)
: profile_(profile), existing_usernames_(std::move(existing_usernames)) { : profile_(profile), existing_usernames_(std::move(existing_usernames)) {
DCHECK(!forms_to_change.empty()); DCHECK(!forms_to_change.empty());
...@@ -21,7 +22,7 @@ PasswordEditDelegateSettingsImpl::PasswordEditDelegateSettingsImpl( ...@@ -21,7 +22,7 @@ PasswordEditDelegateSettingsImpl::PasswordEditDelegateSettingsImpl(
forms_to_change_.reserve(forms_to_change.size()); forms_to_change_.reserve(forms_to_change.size());
for (const auto& password_form : forms_to_change) { for (const auto& password_form : forms_to_change) {
forms_to_change_.push_back( forms_to_change_.push_back(
std::make_unique<autofill::PasswordForm>(*password_form)); std::make_unique<password_manager::PasswordForm>(*password_form));
} }
} }
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include "base/strings/string16.h" #include "base/strings/string16.h"
#include "chrome/browser/android/password_edit_delegate.h" #include "chrome/browser/android/password_edit_delegate.h"
#include "chrome/browser/android/password_editing_bridge.h" #include "chrome/browser/android/password_editing_bridge.h"
#include "components/autofill/core/common/password_form.h" #include "components/password_manager/core/browser/password_form.h"
#include "components/password_manager/core/browser/password_store_consumer.h" #include "components/password_manager/core/browser/password_store_consumer.h"
class Profile; class Profile;
...@@ -27,7 +27,8 @@ class PasswordEditDelegateSettingsImpl : public PasswordEditDelegate { ...@@ -27,7 +27,8 @@ class PasswordEditDelegateSettingsImpl : public PasswordEditDelegate {
// username conflicts with any previously existing ones. // username conflicts with any previously existing ones.
PasswordEditDelegateSettingsImpl( PasswordEditDelegateSettingsImpl(
Profile* profile, Profile* profile,
base::span<const std::unique_ptr<autofill::PasswordForm>> forms_to_change, base::span<const std::unique_ptr<password_manager::PasswordForm>>
forms_to_change,
std::vector<base::string16> existing_usernames); std::vector<base::string16> existing_usernames);
~PasswordEditDelegateSettingsImpl() override; ~PasswordEditDelegateSettingsImpl() override;
...@@ -37,7 +38,7 @@ class PasswordEditDelegateSettingsImpl : public PasswordEditDelegate { ...@@ -37,7 +38,7 @@ class PasswordEditDelegateSettingsImpl : public PasswordEditDelegate {
private: private:
Profile* profile_ = nullptr; Profile* profile_ = nullptr;
std::vector<base::string16> existing_usernames_; std::vector<base::string16> existing_usernames_;
std::vector<std::unique_ptr<autofill::PasswordForm>> forms_to_change_; std::vector<std::unique_ptr<password_manager::PasswordForm>> forms_to_change_;
}; };
#endif // CHROME_BROWSER_ANDROID_PASSWORD_EDIT_DELEGATE_SETTINGS_IMPL_H_ #endif // CHROME_BROWSER_ANDROID_PASSWORD_EDIT_DELEGATE_SETTINGS_IMPL_H_
...@@ -23,7 +23,8 @@ void PasswordEditingBridge::LaunchPasswordEntryEditor( ...@@ -23,7 +23,8 @@ void PasswordEditingBridge::LaunchPasswordEntryEditor(
JNIEnv* env, JNIEnv* env,
const base::android::JavaParamRef<jobject>& context, const base::android::JavaParamRef<jobject>& context,
Profile* profile, Profile* profile,
base::span<const std::unique_ptr<autofill::PasswordForm>> forms_to_change, base::span<const std::unique_ptr<password_manager::PasswordForm>>
forms_to_change,
std::vector<base::string16> existing_usernames) { std::vector<base::string16> existing_usernames) {
// |forms_to_change| is built in // |forms_to_change| is built in
// |PasswordManagerPresnter::TryGetPasswordForms|, which under certain // |PasswordManagerPresnter::TryGetPasswordForms|, which under certain
......
...@@ -39,7 +39,8 @@ class PasswordEditingBridge { ...@@ -39,7 +39,8 @@ class PasswordEditingBridge {
JNIEnv* env, JNIEnv* env,
const base::android::JavaParamRef<jobject>& context, const base::android::JavaParamRef<jobject>& context,
Profile* profile, Profile* profile,
base::span<const std::unique_ptr<autofill::PasswordForm>> forms_to_change, base::span<const std::unique_ptr<password_manager::PasswordForm>>
forms_to_change,
std::vector<base::string16> existing_usernames); std::vector<base::string16> existing_usernames);
void HandleEditSavedPasswordEntry( void HandleEditSavedPasswordEntry(
......
...@@ -30,9 +30,9 @@ ...@@ -30,9 +30,9 @@
#include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/signin/identity_manager_factory.h" #include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/grit/generated_resources.h" #include "chrome/grit/generated_resources.h"
#include "components/autofill/core/common/password_form.h"
#include "components/password_manager/core/browser/export/password_csv_writer.h" #include "components/password_manager/core/browser/export/password_csv_writer.h"
#include "components/password_manager/core/browser/leak_detection/authenticated_leak_check.h" #include "components/password_manager/core/browser/leak_detection/authenticated_leak_check.h"
#include "components/password_manager/core/browser/password_form.h"
#include "components/password_manager/core/browser/password_ui_utils.h" #include "components/password_manager/core/browser/password_ui_utils.h"
#include "components/password_manager/core/browser/ui/credential_provider_interface.h" #include "components/password_manager/core/browser/ui/credential_provider_interface.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
...@@ -73,7 +73,8 @@ Profile* PasswordUIViewAndroid::GetProfile() { ...@@ -73,7 +73,8 @@ Profile* PasswordUIViewAndroid::GetProfile() {
} }
void PasswordUIViewAndroid::SetPasswordList( void PasswordUIViewAndroid::SetPasswordList(
const std::vector<std::unique_ptr<autofill::PasswordForm>>& password_list) { const std::vector<std::unique_ptr<password_manager::PasswordForm>>&
password_list) {
JNIEnv* env = base::android::AttachCurrentThread(); JNIEnv* env = base::android::AttachCurrentThread();
ScopedJavaLocalRef<jobject> ui_controller = weak_java_ui_controller_.get(env); ScopedJavaLocalRef<jobject> ui_controller = weak_java_ui_controller_.get(env);
if (!ui_controller.is_null()) { if (!ui_controller.is_null()) {
...@@ -83,7 +84,7 @@ void PasswordUIViewAndroid::SetPasswordList( ...@@ -83,7 +84,7 @@ void PasswordUIViewAndroid::SetPasswordList(
} }
void PasswordUIViewAndroid::SetPasswordExceptionList( void PasswordUIViewAndroid::SetPasswordExceptionList(
const std::vector<std::unique_ptr<autofill::PasswordForm>>& const std::vector<std::unique_ptr<password_manager::PasswordForm>>&
password_exception_list) { password_exception_list) {
JNIEnv* env = base::android::AttachCurrentThread(); JNIEnv* env = base::android::AttachCurrentThread();
ScopedJavaLocalRef<jobject> ui_controller = weak_java_ui_controller_.get(env); ScopedJavaLocalRef<jobject> ui_controller = weak_java_ui_controller_.get(env);
...@@ -104,7 +105,7 @@ ScopedJavaLocalRef<jobject> PasswordUIViewAndroid::GetSavedPasswordEntry( ...@@ -104,7 +105,7 @@ ScopedJavaLocalRef<jobject> PasswordUIViewAndroid::GetSavedPasswordEntry(
const JavaRef<jobject>&, const JavaRef<jobject>&,
int index) { int index) {
DCHECK_EQ(State::ALIVE, state_); DCHECK_EQ(State::ALIVE, state_);
const autofill::PasswordForm* form = const password_manager::PasswordForm* form =
password_manager_presenter_.GetPassword(index); password_manager_presenter_.GetPassword(index);
if (!form) { if (!form) {
return Java_PasswordUIView_createSavedPasswordEntry( return Java_PasswordUIView_createSavedPasswordEntry(
...@@ -125,7 +126,7 @@ ScopedJavaLocalRef<jstring> PasswordUIViewAndroid::GetSavedPasswordException( ...@@ -125,7 +126,7 @@ ScopedJavaLocalRef<jstring> PasswordUIViewAndroid::GetSavedPasswordException(
const JavaRef<jobject>&, const JavaRef<jobject>&,
int index) { int index) {
DCHECK_EQ(State::ALIVE, state_); DCHECK_EQ(State::ALIVE, state_);
const autofill::PasswordForm* form = const password_manager::PasswordForm* form =
password_manager_presenter_.GetPasswordException(index); password_manager_presenter_.GetPasswordException(index);
if (!form) if (!form)
return ConvertUTF8ToJavaString(env, std::string()); return ConvertUTF8ToJavaString(env, std::string());
...@@ -232,7 +233,7 @@ PasswordUIViewAndroid::ObtainAndSerializePasswords( ...@@ -232,7 +233,7 @@ PasswordUIViewAndroid::ObtainAndSerializePasswords(
credential_provider_for_testing_ ? credential_provider_for_testing_ credential_provider_for_testing_ ? credential_provider_for_testing_
: &password_manager_presenter_; : &password_manager_presenter_;
std::vector<std::unique_ptr<autofill::PasswordForm>> passwords = std::vector<std::unique_ptr<password_manager::PasswordForm>> passwords =
provider->GetAllPasswords(); provider->GetAllPasswords();
// The UI should not trigger serialization if there are not passwords. // The UI should not trigger serialization if there are not passwords.
......
...@@ -50,10 +50,10 @@ class PasswordUIViewAndroid : public PasswordUIView { ...@@ -50,10 +50,10 @@ class PasswordUIViewAndroid : public PasswordUIView {
// PasswordUIView implementation. // PasswordUIView implementation.
Profile* GetProfile() override; Profile* GetProfile() override;
void SetPasswordList( void SetPasswordList(
const std::vector<std::unique_ptr<autofill::PasswordForm>>& password_list) const std::vector<std::unique_ptr<password_manager::PasswordForm>>&
override; password_list) override;
void SetPasswordExceptionList( void SetPasswordExceptionList(
const std::vector<std::unique_ptr<autofill::PasswordForm>>& const std::vector<std::unique_ptr<password_manager::PasswordForm>>&
password_exception_list) override; password_exception_list) override;
// Calls from Java. // Calls from Java.
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
#include "base/macros.h" #include "base/macros.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "components/autofill/core/common/password_form.h"
#include "components/password_manager/core/browser/export/password_csv_writer.h" #include "components/password_manager/core/browser/export/password_csv_writer.h"
#include "components/password_manager/core/browser/password_form.h"
#include "components/password_manager/core/browser/ui/credential_provider_interface.h" #include "components/password_manager/core/browser/ui/credential_provider_interface.h"
#include "content/public/test/browser_task_environment.h" #include "content/public/test/browser_task_environment.h"
#include "content/public/test/test_utils.h" #include "content/public/test/test_utils.h"
...@@ -33,9 +33,9 @@ ...@@ -33,9 +33,9 @@
namespace android { namespace android {
using autofill::PasswordForm;
using base::android::AttachCurrentThread; using base::android::AttachCurrentThread;
using base::android::JavaParamRef; using base::android::JavaParamRef;
using password_manager::PasswordForm;
namespace { namespace {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment