tree: d0fe9e70fa9a516ccfce48b79d34591363384253 [path history] [tgz]
  1. accelerators/
  2. accessibility/
  3. animation/
  4. app_list/
  5. autoclick/
  6. content/
  7. display/
  8. drag_drop/
  9. fast_ink/
  10. first_run/
  11. frame/
  12. high_contrast/
  13. highlighter/
  14. host/
  15. ime/
  16. keyboard/
  17. laser/
  18. lock_screen_action/
  19. login/
  20. magnifier/
  21. message_center/
  22. metrics/
  23. mus/
  24. perftests/
  25. public/
  26. resources/
  27. rotator/
  28. session/
  29. shelf/
  30. shell/
  31. sticky_keys/
  32. strings/
  33. system/
  34. test/
  35. tooltips/
  36. touch/
  37. touch_hud/
  38. tray_action/
  39. utility/
  40. voice_interaction/
  41. wallpaper/
  42. wayland/
  43. wm/
  44. accessibility_types.h
  45. ash_constants.cc
  46. ash_constants.h
  47. ash_export.h
  48. ash_layout_constants.cc
  49. ash_layout_constants.h
  50. ash_strings.grd
  51. ash_touch_exploration_manager_chromeos.cc
  52. ash_touch_exploration_manager_chromeos.h
  53. ash_touch_exploration_manager_chromeos_unittest.cc
  54. ash_view_ids.h
  55. BUILD.gn
  56. cancel_mode.cc
  57. cancel_mode.h
  58. cast_config_controller.cc
  59. cast_config_controller.h
  60. debug.cc
  61. debug.h
  62. default_wallpaper_delegate.cc
  63. default_wallpaper_delegate.h
  64. DEPS
  65. dip_unittest.cc
  66. extended_desktop_unittest.cc
  67. focus_cycler.cc
  68. focus_cycler.h
  69. focus_cycler_unittest.cc
  70. gpu_support.h
  71. gpu_support_stub.cc
  72. gpu_support_stub.h
  73. login_status.h
  74. media_controller.cc
  75. media_controller.h
  76. mojo_interface_factory.cc
  77. mojo_interface_factory.h
  78. mojo_test_interface_factory.cc
  79. mojo_test_interface_factory.h
  80. multi_profile_uma.cc
  81. multi_profile_uma.h
  82. mus_property_mirror_ash_unittest.cc
  83. new_window_controller.cc
  84. new_window_controller.h
  85. note_taking_controller.cc
  86. note_taking_controller.h
  87. OWNERS
  88. pointer_watcher_adapter_classic.cc
  89. pointer_watcher_adapter_classic.h
  90. pointer_watcher_adapter_classic_unittest.cc
  91. README.md
  92. root_window_controller.cc
  93. root_window_controller.h
  94. root_window_controller_unittest.cc
  95. root_window_settings.cc
  96. root_window_settings.h
  97. scoped_root_window_for_new_windows.cc
  98. scoped_root_window_for_new_windows.h
  99. screen_util.cc
  100. screen_util.h
  101. screen_util_unittest.cc
  102. screenshot_delegate.h
  103. shell.cc
  104. shell.h
  105. shell_delegate.h
  106. shell_init_params.h
  107. shell_observer.h
  108. shell_port.cc
  109. shell_port.h
  110. shell_port_classic.cc
  111. shell_port_classic.h
  112. shell_test_api.cc
  113. shell_test_api.h
  114. shell_unittest.cc
  115. shutdown_controller.cc
  116. shutdown_controller.h
  117. shutdown_reason.h
  118. test_media_client.cc
  119. test_media_client.h
  120. test_screenshot_delegate.cc
  121. test_screenshot_delegate.h
  122. test_shell_delegate.cc
  123. test_shell_delegate.h
  124. virtual_keyboard_controller.cc
  125. virtual_keyboard_controller.h
  126. virtual_keyboard_controller_unittest.cc
  127. window_user_data.h
  128. window_user_data_unittest.cc
ash/README.md

Ash

Ash is the “Aura Shell”, the window manager and system UI for Chrome OS. Ash uses the views UI toolkit (e.g. views::View, views::Widget, etc.) backed by the aura native widget and layer implementations.

Ash sits below chrome in the dependency graph (i.e. it cannot depend on code in //chrome). It has a few dependencies on //content, but these are isolated in their own module in //ash/content. This allows targets like ash_unittests to build more quickly.

Tests

Most tests should be added to the ash_unittests target. Tests that rely on //content should be added to ash_content_unittests, but these should be rare.

Tests can bring up most of the ash UI and simulate a login session by deriving from AshTestBase. This is often needed to test code that depends on ash::Shell and the controllers it owns.

Test support code (TestFooDelegate, FooControllerTestApi, etc.) lives in the same directory as the class under test (e.g. //ash/foo rather than //ash/test). Test code uses namespace ash; there is no special “test” namespace.

Mustash

Ash is transitioning to use the mus window server and gpu process, found in //services/ui. Ash continues to use aura, but aura is backed by mus. Code to support mus is found in //ash/mus. There should be relatively few differences between the pure aura and the aura-mus versions of ash. Ash can by run in mus mode by passing the --mus command line flag.

Ash is also transitioning to run as a mojo service in its own process. This means that code in chrome cannot call into ash directly, but must use the mojo interfaces in //ash/public/interfaces.

Out-of-process Ash is referred to as “mash” (mojo ash). In-process ash is referred to as “classic ash”. Ash can run in either mode depending on the --mash command line flag.

In the few cases where chrome code is allowed to call into ash (e.g. code that will only ever run in classic ash) the #include lines have “// mash-ok” appended. This makes it easier to use grep to determine which parts of chrome have not yet been adapted to mash.

Mustash Tests

ash_unittests --mus runs the test suite in mus mode. ash_unittests --mash runs in mash mode. Some tests will fail because the underlying code has not yet been ported to work with mash. We use filter files to skip these tests, because it makes it easier to run the entire suite without the filter to see what passes.

To simulate what the bots run (e.g. to check if you broke an existing test that works under mash) you can run:

ash_unittests --mash --test-launcher-filter-file=testing/buildbot/filters/ash_unittests_mash.filter

Any new feature you add (and its tests) should work under mash. If your test cannot pass under mash due to some dependency being broken you may add the test to the filter file. Make sure there is a bug for the underlying issue and cite it in the filter file.

Prefs

Ash supports both per-user prefs and device-wide prefs. These are called “profile prefs” and “local state” to match the naming conventions in chrome. Ash also supports “signin screen” prefs, bound to a special profile that allows users to toggle features like spoken feedback at the login screen.

Local state prefs are loaded asynchronously during startup. User prefs are loaded asynchronously after login, and after adding a multiprofile user. Code that wants to observe prefs must wait until they are loaded. See ShellObserver::OnLocalStatePrefServiceInitialized() and SessionObserver::OnActiveUserPrefServiceChanged(). All PrefService objects exist for the lifetime of the login session, including the signin prefs.

Pref names are in //ash/public/cpp so that code in chrome can also use the names. Prefs are registered in the classes that use them because those classes have the best knowledge of default values.

All PrefService instances in ash are backed by the mojo preferences service. This means an update to a pref is asynchronous between code in ash and code in chrome. For example, if code in chrome changes a pref value then immediately calls a C++ function in ash, that ash function may not see the new value yet. (This pattern only happens in the classic ash configuration; code in chrome cannot call directly into the ash process in the mash config.)

Prefs are either “owned” by ash or by chrome browser. New prefs used by ash should be owned by ash. See NightLightController and LogoutButtonTray for examples of ash-owned prefs. See //services/preferences/README.md for details of pref ownership and “foreign” prefs.

Historical notes

Ash shipped on Windows for a couple years to support Windows 8 Metro mode. Windows support was removed in 2016.