diff --git a/core/modules/shortcut/lib/Drupal/shortcut/Controller/ShortcutController.php b/core/modules/shortcut/lib/Drupal/shortcut/Controller/ShortcutController.php
index e8e6cdc..decc4c3 100644
--- a/core/modules/shortcut/lib/Drupal/shortcut/Controller/ShortcutController.php
+++ b/core/modules/shortcut/lib/Drupal/shortcut/Controller/ShortcutController.php
@@ -8,7 +8,11 @@
 
 use Drupal\Core\ControllerInterface;
 use Drupal\Core\Entity\EntityManager;
+use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\shortcut\ShortcutInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
 
 /**
  * Builds the page for administering shortcut sets.
@@ -16,6 +20,13 @@
 class ShortcutController implements ControllerInterface {
 
   /**
+   * The module handler.
+   *
+   * @var \Drupal\Core\Extension\ModuleHandlerInterface
+   */
+  protected $moduleHandler;
+
+  /**
    * Stores the entity manager.
    *
    * @var \Drupal\Core\Entity\EntityManager
@@ -27,16 +38,22 @@ class ShortcutController implements ControllerInterface {
    *
    * @param \Drupal\Core\Entity\EntityManager $entity_manager
    *   The entity manager.
+   * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
+   *   The module handler.
    */
-   public function __construct(EntityManager $entity_manager) {
+   public function __construct(EntityManager $entity_manager, ModuleHandlerInterface $module_handler) {
      $this->entityManager = $entity_manager;
+     $this->moduleHandler = $module_handler;
    }
 
   /**
    * {@inheritdoc}
    */
   public static function create(ContainerInterface $container) {
-    return new static($container->get('plugin.manager.entity'));
+    return new static(
+      $container->get('plugin.manager.entity'),
+      $container->get('module_handler')
+    );
   }
 
   /**
@@ -49,4 +66,40 @@ public function shortcutSetAdmin() {
     return $this->entityManager->getListController('shortcut')->render();
   }
 
+  /**
+   * Creates a new link in the provided shortcut set.
+   *
+   * After completion, redirects the user back to where they came from.
+   *
+   * @param \Drupal\shortcut\ShortcutInterface $shortcut
+   *   The shortcut set to add a link to.
+   * @param \Symfony\Component\HttpFoundation\Request $request
+   *   The request object.
+   *
+   * @throws \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException
+   */
+  public function addShortcutLinkInline(ShortcutInterface $shortcut, Request $request) {
+    $token = $request->query->get('token');
+    $link = $request->query->get('link');
+    if (isset($token) && drupal_valid_token($token, 'shortcut-add-link') && shortcut_valid_link($link)) {
+      $item = menu_get_item($link);
+      $title = ($item && $item['title']) ? $item['title'] : $link;
+      $link = array(
+        'link_title' => $title,
+        'link_path' => $link,
+      );
+      $this->moduleHandler->loadInclude('shortcut', 'admin.inc');
+      shortcut_admin_add_link($link, $shortcut);
+      if ($shortcut->save() == SAVED_UPDATED) {
+        drupal_set_message(t('Added a shortcut for %title.', array('%title' => $link['link_title'])));
+      }
+      else {
+        drupal_set_message(t('Unable to add a shortcut for %title.', array('%title' => $link['link_title'])));
+      }
+      drupal_goto();
+    }
+
+    throw new AccessDeniedHttpException();
+  }
+
 }
diff --git a/core/modules/shortcut/shortcut.admin.inc b/core/modules/shortcut/shortcut.admin.inc
index 2f7acf6..879f68c 100644
--- a/core/modules/shortcut/shortcut.admin.inc
+++ b/core/modules/shortcut/shortcut.admin.inc
@@ -463,32 +463,3 @@ function shortcut_admin_add_link($shortcut_link, &$shortcut_set) {
   $shortcut_set->links[$menu_link->uuid()] = $menu_link;
   shortcut_set_reset_link_weights($shortcut_set);
 }
-
-/**
- * Menu page callback: creates a new link in the provided shortcut set.
- *
- * After completion, redirects the user back to where they came from.
- *
- * @param $shortcut_set Drupal\shortcut\Plugin\Core\Entity\Shortcut
- *   Returned from shortcut_set_load().
- */
-function shortcut_link_add_inline($shortcut_set) {
-  if (isset($_REQUEST['token']) && drupal_valid_token($_REQUEST['token'], 'shortcut-add-link') && shortcut_valid_link($_GET['link'])) {
-    $item = menu_get_item($_GET['link']);
-    $title = ($item && $item['title']) ? $item['title'] : $_GET['name'];
-    $link = array(
-      'link_title' => $title,
-      'link_path' => $_GET['link'],
-    );
-    shortcut_admin_add_link($link, $shortcut_set);
-    if ($shortcut_set->save() == SAVED_UPDATED) {
-      drupal_set_message(t('Added a shortcut for %title.', array('%title' => $link['link_title'])));
-    }
-    else {
-      drupal_set_message(t('Unable to add a shortcut for %title.', array('%title' => $link['link_title'])));
-    }
-    drupal_goto();
-  }
-
-  throw new AccessDeniedHttpException();
-}
diff --git a/core/modules/shortcut/shortcut.module b/core/modules/shortcut/shortcut.module
index db284c5..577ff04 100644
--- a/core/modules/shortcut/shortcut.module
+++ b/core/modules/shortcut/shortcut.module
@@ -129,15 +129,6 @@ function shortcut_menu() {
     'type' => MENU_LOCAL_ACTION,
     'file' => 'shortcut.admin.inc',
   );
-  $items['admin/config/user-interface/shortcut/manage/%shortcut_set/add-link-inline'] = array(
-    'title' => 'Add shortcut',
-    'page callback' => 'shortcut_link_add_inline',
-    'page arguments' => array(5),
-    'access callback' => 'shortcut_set_edit_access',
-    'access arguments' => array(5),
-    'type' => MENU_CALLBACK,
-    'file' => 'shortcut.admin.inc',
-  );
   $items['admin/config/user-interface/shortcut/link/%menu_link'] = array(
     'title' => 'Edit shortcut',
     'page callback' => 'drupal_get_form',
diff --git a/core/modules/shortcut/shortcut.routing.yml b/core/modules/shortcut/shortcut.routing.yml
index 761067f..9adb733 100644
--- a/core/modules/shortcut/shortcut.routing.yml
+++ b/core/modules/shortcut/shortcut.routing.yml
@@ -24,3 +24,10 @@ shortcut_set_edit:
     _entity_form: 'shortcut.edit'
   requirements:
     _entity_access: 'shortcut.edit'
+
+shortcut_link_add_inline:
+  pattern: '/admin/config/user-interface/shortcut/manage/{shortcut}/add-link-inline'
+  defaults:
+    _content: 'Drupal\shortcut\Controller\ShortcutController::addShortcutLinkInline'
+  requirements:
+    _entity_access: 'shortcut.edit'
