Currently, we have a whole bunch of classes in Drupal\Core. Generally we should only put stuff there if there's nowhere else that it makes sense. As we've evolved Drupal 8, we've built up a whole bunch of Controller-related stuff in there. It's time to move that to its own namespace.
Additionally, we have several route enhancers to select a controller for routes that do not have one to start with. That's all well and good, but they're all effectively the same. So let's combine them and safe a few classes.
This issue introduces no new functionality; it just moves code around to keep things neat and tidy. Specifically:
* Move all of the controller-related stuff from \Drupal\Core to \Drupal\Core\Controller.
* One of those things is ControllerInterface, which is used by all of the new controller classes we're creating. To avoid all kinds of breakage (including a few dozen patches in the queue), I have left a deprecated subclass in \Drupal\Core for it. That means nothing breaks for now... but we can then change patches over to use the new name and cleanup the work already done in core (in later patches) to use the new name, then remove the old stub. Easy!
* Merge the Page, Dialog, and Modal enhancers into a single enhancer. Really, it's just an array lookup, so let's do that. AjaxEnhancer currently has different logic to support the legacy ajax setup, but once that gets cleaned out it can fold in there, too.
* As part of that cleanup, I moved HtmlPageController and DialogController to services. Yes, most of our controllers are not services but these are "special" in that they're global wrapping services, so this is a step up from ContainerAware. Really, the only service they're using at all is http_kernel. This makes that explicit.
What this does not address is anything with forms, or the fact that forms through dialogs are not currently supported. That's a separate issue. We may be able to address that with a similar approach in FormEnhancer, but let's not get into that here.
Patch as soon as I have a nid.