diff --git a/core/modules/views/includes/ajax.inc b/core/modules/views/includes/ajax.inc
deleted file mode 100644
index 5930856..0000000
--- a/core/modules/views/includes/ajax.inc
+++ /dev/null
@@ -1,63 +0,0 @@
-<?php
-
-/**
- * @file
- * Handles the server side AJAX interactions of Views.
- */
-
-use Drupal\Core\Form\FormStateInterface;
-use Drupal\views\Ajax\HighlightCommand;
-use Drupal\Core\Ajax\OpenModalDialogCommand;
-use Drupal\Core\Ajax\AjaxResponse;
-
-/**
- * Wrapper around \Drupal\Core\Form\FormBuilderInterface::buildForm() to handle
- * some AJAX stuff automatically.
- * This makes some assumptions about the client.
- */
-function views_ajax_form_wrapper($form_class, FormStateInterface &$form_state) {
-  // This won't override settings already in.
-  $form_state->setIfNotExists('rerender', FALSE);
-  $form_state->setIfNotExists('no_redirect', !empty($form_state['ajax']));
-  $form_state->setIfNotExists('no_cache', TRUE);
-  $form_state->setIfNotExists('build_info', array(
-    'args' => array(),
-  ));
-
-  $form = \Drupal::formBuilder()->buildForm($form_class, $form_state);
-  $output = drupal_render($form);
-
-  // These forms have the title built in, so set the title here:
-  if (empty($form_state['ajax']) && !empty($form_state['title'])) {
-    $form['#attached']['css'][] = drupal_get_path('module', 'views_ui') . '/css/views_ui.admin.css';
-  }
-
-  if (!empty($form_state['ajax']) && (empty($form_state['executed']) || !empty($form_state['rerender']))) {
-    // If the form didn't execute and we're using ajax, build up a
-    // Ajax command list to execute.
-    $response = new AjaxResponse();
-
-    $display = '';
-    $status_messages = array('#theme' => 'status_messages');
-    if ($messages = drupal_render($status_messages)) {
-      $display = '<div class="views-messages">' . $messages . '</div>';
-    }
-    $display .= $output;
-
-    $title = empty($form_state['title']) ? '' : $form_state['title'];
-    $options = array(
-      'dialogClass' => 'views-ui-dialog',
-      'width' => '50%',
-    );
-
-    $response->addCommand(new OpenModalDialogCommand($title, $display, $options));
-
-    if (!empty($form_state['#section'])) {
-      $response->addCommand(new HighlightCommand('.' . drupal_clean_css_identifier($form_state['#section'])));
-    }
-
-    return $response;
-  }
-
-  return (!empty($form_state['title'])) ? array('#title' => $form_state['title'], '#markup' => $output) : $output;
-}
diff --git a/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php b/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php
index dc7cb16..a13ff72 100644
--- a/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php
+++ b/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php
@@ -14,6 +14,7 @@
 use Drupal\views\Ajax;
 use Drupal\Core\Ajax\AjaxResponse;
 use Drupal\Core\Ajax\CloseModalDialogCommand;
+use Drupal\Core\Ajax\OpenModalDialogCommand;
 use Symfony\Component\HttpFoundation\RedirectResponse;
 
 /**
@@ -91,7 +92,6 @@ public function getForm(ViewStorageInterface $view, $display_id, $js) {
 
     // @todo Remove the need for this.
     \Drupal::moduleHandler()->loadInclude('views_ui', 'inc', 'admin');
-    \Drupal::moduleHandler()->loadInclude('views', 'inc', 'includes/ajax');
 
     // Reset the cache of IDs. Drupal rather aggressively prevents ID
     // duplication but this causes it to remember IDs that are no longer even
@@ -180,6 +180,74 @@ public function getForm(ViewStorageInterface $view, $display_id, $js) {
   }
 
   /**
+   * Wrapper for handling AJAX forms.
+   *
+   * Wrapper around \Drupal\Core\Form\FormBuilderInterface::buildForm() to handle
+   * some AJAX stuff automatically.
+   * This makes some assumptions about the client.
+   *
+   * @param \Drupal\Core\Form\FormInterface|string $form_arg
+   *   The value must be one of the following:
+   *   - The name of a class that implements \Drupal\Core\Form\FormInterface.
+   *   - An instance of a class that implements \Drupal\Core\Form\FormInterface.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
+   *
+   * @return \Drupal\Core\Ajax\AjaxResponse|string|array
+   *   Returns one of three possible values:
+   *   - A \Drupal\Core\Ajax\AjaxResponse object.
+   *   - The rendered form, as a string.
+   *   - A render array with the title in #title and the rendered form in the
+   *     #markup array.
+   */
+  protected function ajaxFormWrapper($form_arg, FormStateInterface &$form_state) {
+    // This won't override settings already in.
+    $form_state->setIfNotExists('rerender', FALSE);
+    $form_state->setIfNotExists('no_redirect', !empty($form_state['ajax']));
+    $form_state->setIfNotExists('no_cache', TRUE);
+    $form_state->setIfNotExists('build_info', array(
+      'args' => array(),
+    ));
+
+    $form = \Drupal::formBuilder()->buildForm($form_arg, $form_state);
+    $output = drupal_render($form);
+
+    // These forms have the title built in, so set the title here:
+    if (empty($form_state['ajax']) && !empty($form_state['title'])) {
+      $form['#attached']['css'][] = drupal_get_path('module', 'views_ui') . '/css/views_ui.admin.css';
+    }
+
+    if (!empty($form_state['ajax']) && (empty($form_state['executed']) || !empty($form_state['rerender']))) {
+      // If the form didn't execute and we're using ajax, build up a
+      // Ajax command list to execute.
+      $response = new AjaxResponse();
+
+      $display = '';
+      $status_messages = array('#theme' => 'status_messages');
+      if ($messages = drupal_render($status_messages)) {
+        $display = '<div class="views-messages">' . $messages . '</div>';
+      }
+      $display .= $output;
+
+      $title = empty($form_state['title']) ? '' : $form_state['title'];
+      $options = array(
+        'dialogClass' => 'views-ui-dialog',
+        'width' => '50%',
+      );
+
+      $response->addCommand(new OpenModalDialogCommand($title, $display, $options));
+
+      if (!empty($form_state['#section'])) {
+        $response->addCommand(new Ajax\HighlightCommand('.' . drupal_clean_css_identifier($form_state['#section'])));
+      }
+
+      return $response;
+    }
+
+    return (!empty($form_state['title'])) ? array('#title' => $form_state['title'], '#markup' => $output) : $output;
+  }
+
+  /**
    * {@inheritdoc}
    */
   public function validateForm(array &$form, FormStateInterface $form_state) {
