[go: nahoru, domu]

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

Float

Float is another productivity feature that allows users to place one window per desk above others. This is done by moving the window to a container stacked above the desk containers.

In tablet mode, floated windows have a fixed size and are always magnetized to the corners but can be dragged to other corners. The can also be tucked by flinging the window horizontally offscreen. You can bring the window back by pressing on the UI provided while tucked.

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.