#include "chrome/browser/ui/autofill/autofill_client_provider.h"
#include "base/memory/ptr_util.h"
#include "chrome/browser/password_manager/chrome_password_manager_client.h"
#include "chrome/browser/ui/autofill/chrome_autofill_client.h"
#include "components/autofill/core/common/autofill_features.h"
#include "components/autofill/core/common/autofill_prefs.h"
#include "content/public/browser/web_contents.h"
#if BUILDFLAG(IS_ANDROID)
#include "base/android/jni_android.h"
#include "chrome/browser/autofill/android/android_autofill_availability_status.h"
#include "chrome/browser/autofill/android/jni_headers/AutofillClientProviderUtils_jni.h"
#include "chrome/browser/keyboard_accessory/android/manual_filling_controller_impl.h"
#include "components/android_autofill/browser/android_autofill_client.h"
#endif
namespace autofill {
namespace {
#if BUILDFLAG(IS_ANDROID)
AndroidAutofillAvailabilityStatus GetAndroidAutofillAvailabilityStatus(
PrefService& prefs) {
return static_cast<AndroidAutofillAvailabilityStatus>(
Java_AutofillClientProviderUtils_getAndroidAutofillFrameworkAvailability(
base::android::AttachCurrentThread(), prefs.GetJavaObject()));
}
#endif
#if BUILDFLAG(IS_ANDROID)
void RecordAvailabilityStatus(AndroidAutofillAvailabilityStatus availability) {
base::UmaHistogramEnumeration("Autofill.AndroidAutofillAvailabilityStatus",
availability);
}
void RecordWhetherAndroidPrefResets(PrefService& prefs,
bool uses_platform_autofill) {
const bool will_reset_pref =
prefs.GetBoolean(prefs::kAutofillUsingVirtualViewStructure) &&
!uses_platform_autofill;
base::UmaHistogramBoolean("Autofill.ResetAutofillPrefToChrome",
will_reset_pref);
}
#endif
bool UsesVirtualViewStructureForAutofill(PrefService& prefs) { … }
}
AutofillClientProvider::AutofillClientProvider(PrefService* prefs)
: … { … }
AutofillClientProvider::~AutofillClientProvider() = default;
void AutofillClientProvider::CreateClientForWebContents(
content::WebContents* web_contents) { … }
}