tree: 047e6126fb2316a22ac8532815dbfd6421fb1358 [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. perftests/
  24. public/
  25. resources/
  26. rotator/
  27. session/
  28. shelf/
  29. shell/
  30. sidebar/
  31. standalone/
  32. sticky_keys/
  33. strings/
  34. system/
  35. test/
  36. tooltips/
  37. touch/
  38. touch_hud/
  39. tray_action/
  40. utility/
  41. voice_interaction/
  42. wallpaper/
  43. wayland/
  44. wm/
  45. app_launch_unittest.cc
  46. ash_constants.cc
  47. ash_constants.h
  48. ash_export.h
  49. ash_layout_constants.cc
  50. ash_layout_constants.h
  51. ash_strings.grd
  52. ash_touch_exploration_manager_chromeos.cc
  53. ash_touch_exploration_manager_chromeos.h
  54. ash_touch_exploration_manager_chromeos_unittest.cc
  55. ash_view_ids.h
  56. BUILD.gn
  57. cancel_mode.cc
  58. cancel_mode.h
  59. cast_config_controller.cc
  60. cast_config_controller.h
  61. debug.cc
  62. debug.h
  63. default_wallpaper_delegate.cc
  64. default_wallpaper_delegate.h
  65. DEPS
  66. dip_unittest.cc
  67. disconnected_app_handler.cc
  68. disconnected_app_handler.h
  69. event_matcher_util.cc
  70. event_matcher_util.h
  71. extended_desktop_unittest.cc
  72. focus_cycler.cc
  73. focus_cycler.h
  74. focus_cycler_unittest.cc
  75. login_status.h
  76. main.cc
  77. manifest.json
  78. media_controller.cc
  79. media_controller.h
  80. mojo_interface_factory.cc
  81. mojo_interface_factory.h
  82. mojo_test_interface_factory.cc
  83. mojo_test_interface_factory.h
  84. multi_profile_uma.cc
  85. multi_profile_uma.h
  86. mus_property_mirror_ash_unittest.cc
  87. network_connect_delegate_mus.cc
  88. network_connect_delegate_mus.h
  89. new_window_controller.cc
  90. new_window_controller.h
  91. note_taking_controller.cc
  92. note_taking_controller.h
  93. OWNERS
  94. pointer_watcher_adapter_classic.cc
  95. pointer_watcher_adapter_classic.h
  96. pointer_watcher_adapter_classic_unittest.cc
  97. README.md
  98. root_window_controller.cc
  99. root_window_controller.h
  100. root_window_controller_unittest.cc
  101. root_window_settings.cc
  102. root_window_settings.h
  103. scoped_root_window_for_new_windows.cc
  104. scoped_root_window_for_new_windows.h
  105. screen_util.cc
  106. screen_util.h
  107. screen_util_unittest.cc
  108. screenshot_delegate.h
  109. shell.cc
  110. shell.h
  111. shell_delegate.h
  112. shell_delegate_mus.cc
  113. shell_delegate_mus.h
  114. shell_init_params.cc
  115. shell_init_params.h
  116. shell_observer.h
  117. shell_port.cc
  118. shell_port.h
  119. shell_port_classic.cc
  120. shell_port_classic.h
  121. shell_port_mash.cc
  122. shell_port_mash.h
  123. shell_port_mus.cc
  124. shell_port_mus.h
  125. shell_test_api.cc
  126. shell_test_api.h
  127. shell_unittest.cc
  128. shutdown_controller.cc
  129. shutdown_controller.h
  130. shutdown_reason.h
  131. test_media_client.cc
  132. test_media_client.h
  133. test_screenshot_delegate.cc
  134. test_screenshot_delegate.h
  135. test_shell_delegate.cc
  136. test_shell_delegate.h
  137. virtual_keyboard_container_layout_manager.cc
  138. virtual_keyboard_container_layout_manager.h
  139. virtual_keyboard_controller.cc
  140. virtual_keyboard_controller.h
  141. virtual_keyboard_controller_unittest.cc
  142. window_manager.cc
  143. window_manager.h
  144. window_manager_common_unittests.cc
  145. window_manager_service.cc
  146. window_manager_service.h
  147. window_manager_unittest.cc
  148. window_user_data.h
  149. 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 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.