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