Full profile editor and syncing with WebSettings.

Add all fields to the AutoFill profile editor and sync them
over to WebSettings through BrowserSettings.

Change-Id: I5eb69ba802571d2261ea11851bdf1b515ca8fb8c
diff --git a/res/layout/autofill_settings_fragment.xml b/res/layout/autofill_settings_fragment.xml
index 35dfbe6..327cbd1 100644
--- a/res/layout/autofill_settings_fragment.xml
+++ b/res/layout/autofill_settings_fragment.xml
@@ -13,59 +13,260 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:orientation="vertical">
+    android:fillViewport="true">
 
-<TextView
-    android:layout_width="wrap_content"
-    android:layout_height="wrap_content"
-    android:textAppearance="?android:attr/textAppearanceLarge"
-    android:text="@string/pref_autofill_profile_editor" />
+    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:orientation="vertical"
+        android:padding="20dip">
 
-<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content"
-    android:stretchColumns="1"
-    android:paddingLeft="100dip"
-    android:paddingRight="100dip" >
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:textAppearance="?android:attr/textAppearanceLarge"
+        android:text="@string/pref_autofill_profile_editor" />
 
-    <TableRow>
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:gravity="center_vertical"
-            android:padding="10dip"
-            android:textAppearance="?android:attr/textAppearanceMedium"
-            android:text="@string/autofill_profile_editor_name" />
-        <EditText android:id="@+id/autofill_profile_editor_name_edit"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:textAppearance="?android:attr/textAppearanceMedium"
-            android:singleLine="true" />
-    </TableRow>
-    <TableRow>
-        <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:gravity="center_vertical"
-            android:padding="10dip"
-            android:textAppearance="?android:attr/textAppearanceMedium"
-            android:text="@string/autofill_profile_editor_email_address" />
-        <EditText android:id="@+id/autofill_profile_editor_email_address_edit"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:textAppearance="?android:attr/textAppearanceMedium"
-            android:singleLine="true" />
-    </TableRow>
-</TableLayout>
+    <View
+        android:layout_height="20dip"
+        android:layout_width="match_parent" />
 
-<Button
-    android:id="@+id/autofill_profile_editor_save_button"
-    android:layout_width="wrap_content"
-    android:layout_height="wrap_content"
-    android:text="@string/autofill_profile_editor_save_profile"
-    android:textAppearance="?android:attr/textAppearanceMedium" />
+    <TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_weight="1"
+        android:stretchColumns="1">
+        <TableRow
+            android:layout_height="match_parent"
+            android:layout_weight="1">
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:gravity="center_vertical"
+                android:padding="10dip"
+                android:textAppearance="?android:attr/textAppearanceMedium"
+                android:text="@string/autofill_profile_editor_name" />
+            <EditText android:id="@+id/autofill_profile_editor_name_edit"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:padding="10dip"
+                android:textAppearance="?android:attr/textAppearanceMedium"
+                android:inputType="textPersonName|textCapWords"
+                android:singleLine="true" />
+        </TableRow>
+        <TableRow
+            android:layout_height="match_parent"
+            android:layout_weight="1">
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:gravity="center_vertical"
+                android:padding="10dip"
+                android:textAppearance="?android:attr/textAppearanceMedium"
+                android:text="@string/autofill_profile_editor_company_name" />
+            <EditText android:id="@+id/autofill_profile_editor_company_name_edit"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:padding="10dip"
+                android:textAppearance="?android:attr/textAppearanceMedium"
+                android:singleLine="true" />
+        </TableRow>
+        <TableRow
+            android:layout_height="match_parent"
+            android:layout_weight="1">
+            <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:padding="10dip"
+                android:orientation="vertical">
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:gravity="center_vertical"
+                    android:textAppearance="?android:attr/textAppearanceMedium"
+                    android:text="@string/autofill_profile_editor_address_line_1" />
+                 <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:gravity="center_vertical"
+                    android:textAppearance="?android:attr/textAppearanceSmall"
+                    android:text="@string/autofill_profile_editor_address_line_1_hint" />
+            </LinearLayout>
+            <EditText android:id="@+id/autofill_profile_editor_address_line_1_edit"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:padding="10dip"
+                android:textAppearance="?android:attr/textAppearanceMedium"
+                android:singleLine="true" />
+        </TableRow>
+        <TableRow
+            android:layout_height="match_parent"
+            android:layout_weight="1">
+            <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:padding="10dip"
+                android:orientation="vertical">
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:gravity="center_vertical"
+                    android:textAppearance="?android:attr/textAppearanceMedium"
+                    android:text="@string/autofill_profile_editor_address_line_2" />
+                 <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:gravity="center_vertical"
+                    android:textAppearance="?android:attr/textAppearanceSmall"
+                    android:text="@string/autofill_profile_editor_address_line_2_hint" />
+            </LinearLayout>
+            <EditText android:id="@+id/autofill_profile_editor_address_line_2_edit"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:padding="10dip"
+                android:textAppearance="?android:attr/textAppearanceMedium"
+                android:singleLine="true" />
+        </TableRow>
+        <TableRow
+            android:layout_height="match_parent"
+            android:layout_weight="1">
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:gravity="center_vertical"
+                android:padding="10dip"
+                android:textAppearance="?android:attr/textAppearanceMedium"
+                android:text="@string/autofill_profile_editor_city" />
+            <EditText android:id="@+id/autofill_profile_editor_city_edit"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:padding="10dip"
+                android:textAppearance="?android:attr/textAppearanceMedium"
+                android:singleLine="true" />
+        </TableRow>
+        <TableRow
+            android:layout_height="match_parent"
+            android:layout_weight="1">
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:gravity="center_vertical"
+                android:padding="10dip"
+                android:textAppearance="?android:attr/textAppearanceMedium"
+                android:text="@string/autofill_profile_editor_state" />
+            <EditText android:id="@+id/autofill_profile_editor_state_edit"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:padding="10dip"
+                android:textAppearance="?android:attr/textAppearanceMedium"
+                android:singleLine="true" />
+        </TableRow>
+        <TableRow
+            android:layout_height="match_parent"
+            android:layout_weight="1">
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:gravity="center_vertical"
+                android:padding="10dip"
+                android:textAppearance="?android:attr/textAppearanceMedium"
+                android:text="@string/autofill_profile_editor_zip_code" />
+            <EditText android:id="@+id/autofill_profile_editor_zip_code_edit"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:padding="10dip"
+                android:textAppearance="?android:attr/textAppearanceMedium"
+                android:singleLine="true" />
+        </TableRow>
+       <TableRow
+            android:layout_height="match_parent"
+            android:layout_weight="1">
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:gravity="center_vertical"
+                android:padding="10dip"
+                android:textAppearance="?android:attr/textAppearanceMedium"
+                android:text="@string/autofill_profile_editor_country" />
+            <EditText android:id="@+id/autofill_profile_editor_country_edit"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:padding="10dip"
+                android:textAppearance="?android:attr/textAppearanceMedium"
+                android:singleLine="true" />
+        </TableRow>
+        <TableRow
+            android:layout_height="match_parent"
+            android:layout_weight="1">
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:gravity="center_vertical"
+                android:padding="10dip"
+                android:textAppearance="?android:attr/textAppearanceMedium"
+                android:text="@string/autofill_profile_editor_phone_number" />
+            <EditText android:id="@+id/autofill_profile_editor_phone_number_edit"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:padding="10dip"
+                android:textAppearance="?android:attr/textAppearanceMedium"
+                android:singleLine="true"
+                android:phoneNumber="true" />
+        </TableRow>
+        <TableRow
+            android:layout_height="match_parent"
+            android:layout_weight="1">
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:gravity="center_vertical"
+                android:padding="10dip"
+                android:textAppearance="?android:attr/textAppearanceMedium"
+                android:text="@string/autofill_profile_editor_email_address" />
+            <EditText android:id="@+id/autofill_profile_editor_email_address_edit"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:padding="10dip"
+                android:textAppearance="?android:attr/textAppearanceMedium"
+                android:inputType="textEmailAddress"
+                android:singleLine="true" />
+        </TableRow>
+    </TableLayout>
 
-</LinearLayout>
+    <View
+        android:layout_height="20dip"
+        android:layout_width="match_parent" />
+
+    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal"
+        android:gravity="center">
+    <Button
+        android:id="@+id/autofill_profile_editor_save_button"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="@string/autofill_profile_editor_save_profile"
+        android:textAppearance="?android:attr/textAppearanceMedium" />
+
+    <Button
+        android:id="@+id/autofill_profile_editor_cancel_button"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="@string/cancel"
+        android:textAppearance="?android:attr/textAppearanceMedium" />
+
+    <Button
+        android:id="@+id/autofill_profile_editor_delete_button"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="@string/autofill_profile_editor_delete_profile"
+        android:textAppearance="?android:attr/textAppearanceMedium" />
+    </LinearLayout>
+
+    </LinearLayout>
+</ScrollView>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 0b2d53a..3e7c644 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -349,14 +349,38 @@
     <string name="pref_autofill_profile_editor">AutoFill Settings</string>
     <!-- Summary for the AutoFill Settings preference [CHAR-LIMIT=none] -->
     <string name="pref_autofill_profile_editor_summary">Set up &amp; manage data for AutoFilled forms</string>
+
     <!-- String for the user's full name in the AutoFill profile editor. [CHAR-LIMIT=32] -->
-    <string name="autofill_profile_editor_name">Full Name:</string>
+    <string name="autofill_profile_editor_name">Full name:</string>
     <!-- String for the user's e-mail address in the AutoFill profile editor. [CHAR-LIMIT=32] -->
-    <string name="autofill_profile_editor_email_address">e-mail Address:</string>
+    <string name="autofill_profile_editor_email_address">Email:</string>
+    <!-- String for the user's company name in the AutoFill profile editor. [CHAR-LIMIT=32] -->
+    <string name="autofill_profile_editor_company_name">Company name:</string>
+    <!-- String for the first line of the user's address in the AutoFill profile editor. [CHAR-LIMIT=32] -->
+    <string name="autofill_profile_editor_address_line_1">Address line 1:</string>
+    <!-- String to suggest to the user the kind of data to be used for the first line of the address. CHAR-LIMIT=64] -->
+    <string name="autofill_profile_editor_address_line_1_hint">Street address, P.O. box, c/o</string>
+    <!-- String for the second line of the user's address in the AutoFill profile editor. [CHAR-LIMIT=32] -->
+    <string name="autofill_profile_editor_address_line_2">Address line 2:</string>
+    <!-- String to suggest to the user the kind of data to be used for the second line of the address. CHAR-LIMIT=64] -->
+    <string name="autofill_profile_editor_address_line_2_hint">Apartment, suite, unit, building, floor etc.</string>
+    <!-- String for the user's city or town in the AutoFill profile editor. [CHAR-LIMIT=32] -->
+    <string name="autofill_profile_editor_city">City / Town:</string>
+    <!-- String for the user's state or province or region in the AutoFill profile editor. [CHAR-LIMIT=32] -->
+    <string name="autofill_profile_editor_state">State / Province / Region:</string>
+    <!-- String for the user's zip code in the AutoFill profile editor. [CHAR-LIMIT=32] -->
+    <string name="autofill_profile_editor_zip_code">Zip code:</string>
+    <!-- String for the user's country in the AutoFill profile editor. [CHAR-LIMIT=32] -->
+    <string name="autofill_profile_editor_country">Country:</string>
+    <!-- String for the user's phone number in the AutoFill profile editor. [CHAR-LIMIT=32] -->
+    <string name="autofill_profile_editor_phone_number">Phone:</string>
+
     <!-- Button text to save the AutoFill profile [CHAR-LIMIT=20] -->
     <string name="autofill_profile_editor_save_profile">Save profile</string>
     <!-- Toast message displayed when the profile has been successfully saved [CHAR-LIMIT=none] -->
     <string name="autofill_profile_successful_save">Profile saved</string>
+    <!-- Button text to delete all the AutoFill profile data [CHAR-LIMIT=20] -->
+    <string name="autofill_profile_editor_delete_profile">Delete profile data</string>
 
     <!-- Settings screen, section title -->
     <string name="pref_privacy_title">Privacy settings</string>