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