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

Unified Diff: components/autofill/content/browser/form_data_android.h

Issue 2745803003: autofill-try
Patch Set: before I leave Created 3 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
Index: components/autofill/content/browser/form_data_android.h
diff --git a/components/autofill/content/browser/form_data_android.h b/components/autofill/content/browser/form_data_android.h
new file mode 100644
index 0000000000000000000000000000000000000000..a1502712cc48da3149ea88a0945b2503d9aef5fb
--- /dev/null
+++ b/components/autofill/content/browser/form_data_android.h
@@ -0,0 +1,51 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_AUTOFILL_CONTENT_BROWSER_FORM_DATA_ANDROID_H_
+#define COMPONENTS_AUTOFILL_CONTENT_BROWSER_FORM_DATA_ANDROID_H_
+
+#include "base/android/jni_weak_ref.h"
+#include "base/android/scoped_java_ref.h"
+#include "components/autofill/core/common/form_data.h"
+
+namespace autofill {
+
+class FormFieldDataAndroid;
+
+class FormDataAndroid {
+ public:
+ FormDataAndroid(const FormData& form);
+ virtual ~FormDataAndroid();
+
+ base::android::ScopedJavaLocalRef<jobject> GetJavaPeer();
+
+ // Pull autofill values from Java side and return FormData.
+ const FormData& PullAutofillValues();
+
+ base::android::ScopedJavaLocalRef<jobject> GetNextFormFieldData(
+ JNIEnv*env,
+ const base::android::JavaParamRef<jobject>& jcaller);
+
+ // Get index of given field, return True and index of focus field if found.
+ bool GetFieldIndex(const FormFieldData& field, size_t* index);
+
+ bool SameFormAs(const FormData& form);
+
+ void OnTextFieldDidChange(size_t index, const base::string16& value);
+ private:
+ FormData form_;
+ FormFieldData* focus_field_;
+ std::vector<std::unique_ptr<FormFieldDataAndroid>> fields_;
+ JavaObjectWeakGlobalRef java_ref_;
+ // index to popup fields to Java.
+ size_t index_;
+
+ DISALLOW_COPY_AND_ASSIGN(FormDataAndroid);
+};
+
+bool RegisterFormDataAndroid(JNIEnv* env);
+
+} // namespace autofill
+
+#endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_FORM_DATA_ANDROID_H_

Powered by Google App Engine
This is Rietveld 408576698