Adds a specific disable switch for requestAutocomplete, changes chrome://flags to allow default, enable, disable for the rAc flag.

This also removes the binding between flags for rAc and new dialog style.

BUG=170393

Review URL: https://chromiumcodereview.appspot.com/14722014

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@200417 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index 5f0de4a..c62215f 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -1258,7 +1258,9 @@
     IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_NAME,
     IDS_FLAGS_ENABLE_INTERACTIVE_AUTOCOMPLETE_DESCRIPTION,
     kOsWin | kOsCrOS | kOsAndroid,
-    SINGLE_VALUE_TYPE(switches::kEnableInteractiveAutocomplete)
+    ENABLE_DISABLE_VALUE_TYPE(
+        autofill::switches::kEnableInteractiveAutocomplete,
+        autofill::switches::kDisableInteractiveAutocomplete)
   },
 #if defined(USE_AURA)
   {
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index a93cfad..780bd3f 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -1256,7 +1256,9 @@
 
     // Please keep this in alphabetical order.
     static const char* const kSwitchNames[] = {
+      autofill::switches::kDisableInteractiveAutocomplete,
       autofill::switches::kEnableExperimentalFormFilling,
+      autofill::switches::kEnableInteractiveAutocomplete,
       switches::kAllowHTTPBackgroundPage,
       switches::kAllowLegacyExtensionManifests,
       switches::kAllowScriptingGallery,
@@ -1272,7 +1274,6 @@
       switches::kEnableBenchmarking,
       switches::kEnableExperimentalExtensionApis,
       switches::kEnableIPCFuzzing,
-      switches::kEnableInteractiveAutocomplete,
       switches::kEnableNaCl,
       switches::kEnableNetBenchmarking,
       switches::kEnablePasswordGeneration,
diff --git a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc
index 46122867..5bdb592 100644
--- a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc
+++ b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc
@@ -20,17 +20,6 @@
     views::ViewsDelegate::views_delegate = new ChromeViewsDelegate;
 }
 
-void ChromeBrowserMainExtraPartsViews::PreCreateThreads() {
-  // Enable the new style dialogs when using the interactive autocomplete
-  // dialog. Modifying the command line is only safe before starting threads.
-  // It also has to come after about flags modifies the command line, which
-  // is why it's not possible to do this in ToolkitInitialized.
-  // TODO(estade): remove this.
-  CommandLine* command_line = CommandLine::ForCurrentProcess();
-  if (command_line->HasSwitch(switches::kEnableInteractiveAutocomplete))
-    command_line->AppendSwitch(switches::kEnableNewDialogStyle);
-}
-
 namespace chrome {
 
 void AddViewsToolkitExtraParts(ChromeBrowserMainParts* main_parts) {
diff --git a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h
index b4323c62..d1e34fb 100644
--- a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h
+++ b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h
@@ -15,7 +15,6 @@
 
   // Overridden from ChromeBrowserMainExtraParts:
   virtual void ToolkitInitialized() OVERRIDE;
-  virtual void PreCreateThreads() OVERRIDE;
 
  private:
   DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainExtraPartsViews);