[Autofill Assistant] Remove the preference entry.

Before this patch, we would show a preference entry to enable/disable
Autofill Assistant. The way onboarding works, this is no longer desired.

This patch always removes the preference from the xml so that the patch
is smaller and less controversial to be merged into the release branch.

After this patch, enableing/disabling the feature will entirely be done
during the onboarding flow.

Bug: 806868
Change-Id: I1b10f9cfb55e2d4cf320259f12ed7c3c9fb395c6
Reviewed-on: https://chromium-review.googlesource.com/c/1368649
Commit-Queue: Mathias Carlen <mcarlen@chromium.org>
Reviewed-by: Theresa <twellington@chromium.org>
Reviewed-by: Ganggui Tang <gogerald@chromium.org>
Cr-Commit-Position: refs/heads/master@{#616266}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/MainPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/MainPreferences.java
index f6fc919..b756036 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/MainPreferences.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/MainPreferences.java
@@ -161,9 +161,11 @@
         }
 
         // This checks whether Autofill Assistant is enabled.
-        if (!ChromeFeatureList.isEnabled(ChromeFeatureList.AUTOFILL_ASSISTANT)) {
-            getPreferenceScreen().removePreference(findPreference(PREF_AUTOFILL_ASSISTANT));
-        }
+        // Unconditionally remove the Autofill Assistant preference entry. This is an intermediate
+        // step before completely removing that preference.
+        // TODO(crbug.com/806868): Show the preference when autofill assistant has explicitly been
+        // accepted in the first run screen.
+        getPreferenceScreen().removePreference(findPreference(PREF_AUTOFILL_ASSISTANT));
     }
 
     /**
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/autofill_assistant/AutofillAssistantPreferencesTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/autofill_assistant/AutofillAssistantPreferencesTest.java
index 642f581..ff1959d 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/autofill_assistant/AutofillAssistantPreferencesTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/autofill_assistant/AutofillAssistantPreferencesTest.java
@@ -9,7 +9,6 @@
 import android.support.test.filters.SmallTest;
 
 import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.not;
 import static org.hamcrest.Matchers.nullValue;
 
 import org.junit.Assert;
@@ -125,7 +124,9 @@
     }
 
     /**
-     * Ensure that the "Autofill Assistant" setting is shown when the feature is enabled.
+     * The "Autofill Assistant" preference entry is currently completely disabled.
+     *
+     * Ensure that the entry is not shown when the AUTOFILL_ASSISTANT feature is on.
      */
     @Test
     @SmallTest
@@ -140,7 +141,7 @@
             public void run() {
                 MainPreferences mainPrefs = (MainPreferences) preferences.getFragmentForTest();
                 Assert.assertThat(mainPrefs.findPreference(MainPreferences.PREF_AUTOFILL_ASSISTANT),
-                        is(not(nullValue())));
+                        is(nullValue()));
             }
         });
     }