tree: f26aa140232f95584b5ef9d76923c0d27b1e6c39 [path history] [tgz]
  1. apps_command_source.cc
  2. apps_command_source.h
  3. bookmark_command_source.cc
  4. bookmark_command_source.h
  5. command_source.cc
  6. command_source.h
  7. commander.cc
  8. commander.h
  9. commander_backend.h
  10. commander_controller.cc
  11. commander_controller.h
  12. commander_controller_unittest.cc
  13. commander_frontend.h
  14. commander_view_model.cc
  15. commander_view_model.h
  16. DIR_METADATA
  17. fuzzy_finder.cc
  18. fuzzy_finder.h
  19. fuzzy_finder_unittest.cc
  20. OWNERS
  21. README.md
  22. simple_command_source.cc
  23. simple_command_source.h
chrome/browser/ui/commander/README.md

Commander overview

This directory contains the bulk of the Commander, a new UI surface that allows users to access most Chromium functionality via a keyboard interface.

Components

The three main components of the commander are:

View

The view is responsible for passing user input to the controller and displaying the subsequent results, delivered in a CommanderViewModel. The implementation will most likely be WebUI hosted in a Views toolkit widget.

Command Sources

Command sources (CommandSource) are responsible for providing a list of possible commands (CommandItem) for the user's current context, then executing them if they are chosen.

Controller

The controller (CommanderController) is responsible for maintaining a list of command sources, passing user input to them, and sorting and ranking the result.

If a command requires more input (for example, choosing a window to move the current tab to), the command source will provide a delegate which implements the same CommanderBackend interface as the controller. The controller then mediates between the delegate and the view.

Relationships

To sum up the relationships of the classes in this file:

CommandController (a singleton), owns multiple CommandSources. On user input, each CommandSource provides the controller with matching CommandItems. The controller sorts, ranks and processes the CommandItems, producing a CommanderViewModel and sending it to the view.

When the controller receives a message indicating that the user has chosen an option, the CommandItem is executed if it‘s “one-shot”. Otherwise, it’s a composite command and a delegate CommanderBackend is created. The controller mediates between the delegate and view, passing input to the delegate and view models to the view until the command is either completed or cancelled.