tree: 481105f66d55315363d79b11f098a90f66b125cd [path history] [tgz]
  1. DEPS
  2. DIR_METADATA
  3. OWNERS
  4. README.md
  5. always_on_top_controller.cc
  6. always_on_top_controller.h
  7. always_on_top_controller_unittest.cc
  8. ash_focus_rules.cc
  9. ash_focus_rules.h
  10. ash_focus_rules_unittest.cc
  11. base_state.cc
  12. base_state.h
  13. client_controlled_state.cc
  14. client_controlled_state.h
  15. client_controlled_state_unittest.cc
  16. collision_detection/
  17. container_finder.cc
  18. container_finder.h
  19. container_finder_unittest.cc
  20. cursor_manager_chromeos.cc
  21. cursor_manager_chromeos.h
  22. cursor_manager_test_api.cc
  23. cursor_manager_test_api.h
  24. default_state.cc
  25. default_state.h
  26. default_window_resizer.cc
  27. default_window_resizer.h
  28. default_window_resizer_unittest.cc
  29. desks/
  30. drag_details.cc
  31. drag_details.h
  32. drag_window_controller.cc
  33. drag_window_controller.h
  34. drag_window_resizer.cc
  35. drag_window_resizer.h
  36. drag_window_resizer_unittest.cc
  37. event_client_impl.cc
  38. event_client_impl.h
  39. fullscreen_window_finder.cc
  40. fullscreen_window_finder.h
  41. fullscreen_window_finder_unittest.cc
  42. gestures/
  43. immersive_context_ash.cc
  44. immersive_context_ash.h
  45. immersive_fullscreen_controller_unittest.cc
  46. lock_action_handler_layout_manager.cc
  47. lock_action_handler_layout_manager.h
  48. lock_action_handler_layout_manager_unittest.cc
  49. lock_layout_manager.cc
  50. lock_layout_manager.h
  51. lock_layout_manager_unittest.cc
  52. lock_state_controller.cc
  53. lock_state_controller.h
  54. lock_state_controller_test_api.cc
  55. lock_state_controller_test_api.h
  56. lock_state_controller_unittest.cc
  57. lock_state_observer.h
  58. lock_window_state.cc
  59. lock_window_state.h
  60. mru_window_tracker.cc
  61. mru_window_tracker.h
  62. mru_window_tracker_unittest.cc
  63. native_cursor_manager_ash.cc
  64. native_cursor_manager_ash.h
  65. native_cursor_manager_ash_unittest.cc
  66. overlay_event_filter.cc
  67. overlay_event_filter.h
  68. overlay_event_filter_unittest.cc
  69. overlay_layout_manager.cc
  70. overlay_layout_manager.h
  71. overlay_layout_manager_unittest.cc
  72. overview/
  73. pip/
  74. resize_shadow.cc
  75. resize_shadow.h
  76. resize_shadow_and_cursor_unittest.cc
  77. resize_shadow_controller.cc
  78. resize_shadow_controller.h
  79. root_window_layout_manager.cc
  80. root_window_layout_manager.h
  81. root_window_layout_manager_unittest.cc
  82. screen_dimmer.cc
  83. screen_dimmer.h
  84. screen_dimmer_unittest.cc
  85. screen_pinning_controller.cc
  86. screen_pinning_controller.h
  87. screen_pinning_controller_unittest.cc
  88. session_state_animator.cc
  89. session_state_animator.h
  90. session_state_animator_impl.cc
  91. session_state_animator_impl.h
  92. session_state_animator_impl_unittest.cc
  93. splitview/
  94. stacking_controller.cc
  95. stacking_controller.h
  96. stacking_controller_unittest.cc
  97. switchable_windows.cc
  98. switchable_windows.h
  99. system_gesture_event_filter.cc
  100. system_gesture_event_filter.h
  101. system_gesture_event_filter_unittest.cc
  102. system_modal_container_event_filter.cc
  103. system_modal_container_event_filter.h
  104. system_modal_container_event_filter_delegate.h
  105. system_modal_container_layout_manager.cc
  106. system_modal_container_layout_manager.h
  107. system_modal_container_layout_manager_unittest.cc
  108. system_wallpaper_controller.cc
  109. system_wallpaper_controller.h
  110. tablet_mode/
  111. test_activation_delegate.cc
  112. test_activation_delegate.h
  113. test_child_modal_parent.cc
  114. test_child_modal_parent.h
  115. test_overlay_delegate.cc
  116. test_overlay_delegate.h
  117. test_session_state_animator.cc
  118. test_session_state_animator.h
  119. toplevel_window_event_handler.cc
  120. toplevel_window_event_handler.h
  121. toplevel_window_event_handler_unittest.cc
  122. video_detector.cc
  123. video_detector.h
  124. video_detector_unittest.cc
  125. window_animations.cc
  126. window_animations.h
  127. window_animations_unittest.cc
  128. window_cycle_controller.cc
  129. window_cycle_controller.h
  130. window_cycle_controller_unittest.cc
  131. window_cycle_event_filter.cc
  132. window_cycle_event_filter.h
  133. window_cycle_list.cc
  134. window_cycle_list.h
  135. window_dimmer.cc
  136. window_dimmer.h
  137. window_dimmer_unittest.cc
  138. window_finder.cc
  139. window_finder_unittest.cc
  140. window_manager_unittest.cc
  141. window_mini_view.cc
  142. window_mini_view.h
  143. window_mirror_view.cc
  144. window_mirror_view.h
  145. window_mirror_view_pip.cc
  146. window_mirror_view_pip.h
  147. window_mirror_view_unittest.cc
  148. window_modality_controller_unittest.cc
  149. window_positioner.cc
  150. window_positioner.h
  151. window_positioner_unittest.cc
  152. window_positioning_utils.cc
  153. window_positioning_utils.h
  154. window_positioning_utils_unittest.cc
  155. window_preview_view.cc
  156. window_preview_view.h
  157. window_preview_view_test_api.cc
  158. window_preview_view_test_api.h
  159. window_preview_view_unittest.cc
  160. window_properties.cc
  161. window_properties.h
  162. window_resizer.cc
  163. window_resizer.h
  164. window_state.cc
  165. window_state.h
  166. window_state_delegate.cc
  167. window_state_delegate.h
  168. window_state_observer.h
  169. window_state_unittest.cc
  170. window_state_util.cc
  171. window_state_util.h
  172. window_transient_descendant_iterator.cc
  173. window_transient_descendant_iterator.h
  174. window_transient_descendant_iterator_unittest.cc
  175. window_util.cc
  176. window_util.h
  177. window_util_unittest.cc
  178. wm_default_layout_manager.cc
  179. wm_default_layout_manager.h
  180. wm_event.cc
  181. wm_event.h
  182. wm_highlight_item_border.cc
  183. wm_highlight_item_border.h
  184. wm_shadow_controller_delegate.cc
  185. wm_shadow_controller_delegate.h
  186. work_area_insets.cc
  187. work_area_insets.h
  188. work_area_insets_unittest.cc
  189. workspace/
  190. workspace_controller.cc
  191. workspace_controller.h
  192. workspace_controller_test_api.cc
  193. workspace_controller_test_api.h
  194. workspace_controller_unittest.cc
ash/wm/README.md

Window Manager

Overview

This is the ash window manager, which allows users to manipulate and/or modify windows. Windows are normally described as a views::Widget which has an associated aura::Window. The windows managed are application windows and are parented to a switchable container.

Notable classes

MruWindowTracker

MruWindowTracker allows us to grab a list of application windows in most recently used order. This will only grab windows in the switchable containers and filters can be applied. There are some commonly used filters, these are split into helper functions. The MRU list can be accessed anywhere in ash code.

#include "ash/wm/mru_window_tracker.h"

auto windows = Shell::Get()->mru_window_tracker()->BuildMruWindowList(kActiveDesk);

WindowResizer

WindowResizer is the base class for window drag and resize logic. A subclass of this, depending on the scenario may be created by ToplevelWindowEventHandler when a valid event is seen. The event handler will then forward the events to the subclass. The subclass will then handle positioning and resizing the window, as well as creating supporting UIs (i.e. phantoms) and possibly changing the window state on drag end.

WindowState

WindowState is a wrapper around the window‘s aura::Window that lets us modify and query info about a window’s state (i.e. maximized, minimized). It also takes care of animations when changing states. It owns a State object that can be overridden for different modes (ie. ClientControlledWindowState for ARC apps, TabletModeWindowState for all other apps in tablet mode). Helpers exist for common state changes, less common state changes can be sent WMEvent's. The WindowState of a window can be accessed anywhere in ash.

#include "ash/wm/window_state.h"

WindowState* window_state = WindowState::Get(window);
WMEvent wm_event(WM_EVENT_SNAP_LEFT);
window_state->OnWMEvent(&wm_event);
// WindowState will compute the animation and target bounds and animate the
// window to the left half.

Features

The following are features that are larger or more complex, or have many interactions with non window manager features.

Desks

Desks is a productivity feature that allows users to place windows on a virtual desk. Only the windows associated with the active desk will be visible. On switching desks, the windows associated with the old active desk slide out, and the windows associated with the new active desk slide in. Desks can be created, accessed and destroyed using accelerators or a desk UI in overview mode.

Gestures

Gestures provide a quick way of doing window management. This folder contains gesture centric features like the back gesture and touch pad gestures, but other features can have gestures built in (i.e. overview swipe to close).

Overview

Overview mode, previously known as window selector is a mode which displays all your current windows. It provides an entry to desks and splitview. In clamshell, you can access it doing a 3-finger swipe down on the trackpad, or pressing F5. In tablet, you can access by swiping up on the shelf.

Splitview

Splitview is a productivity feature that allows using two windows side by side with no real estate wasted. It can be activated by drag-drop in overview, ALT+[ or ALT+] accelerators, or swiping up from the shelf in tablet mode.

Tablet Mode

TabletModeController contains the logic to determine when a user wants to use the Chromebook as a tablet. It then notifies many observers (i.e. shelf, app list, chrome browser) to make their UI's more touch friendly or account for the lack of a keyboard. Some features are also tablet mode only. They can register as an observer, or check TabletModeController::InTabletMode.

WindowCycleController

Window cycler, or ALT+TAB allows you to switch between windows and view thumbnails of running windows. Tapping TAB or SHIFT+TAB while holding ALT allows cycling through the UI. If the accelerator is tapped quick enough, the UI will not be shown.

Performance

Window management features commonly involve moving, fading or updating one or many windows. The windows are usually large textures and on top of that, we may need supporting UI (i.e. indicators, phantoms) which may also be large and need to be animated. This can lead to poor performance on low end devices. If the feature has many large moving parts, consider adding metrics (ThroughputTracker , PresentationTimeRecorder), adding a tast test and monitoring the dashboards.