app_list_controller_impl.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565
  1. // Copyright 2018 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef ASH_APP_LIST_APP_LIST_CONTROLLER_IMPL_H_
  5. #define ASH_APP_LIST_APP_LIST_CONTROLLER_IMPL_H_
  6. #include <memory>
  7. #include <string>
  8. #include <utility>
  9. #include <vector>
  10. #include "ash/app_list/app_list_color_provider_impl.h"
  11. #include "ash/app_list/app_list_metrics.h"
  12. #include "ash/app_list/app_list_view_delegate.h"
  13. #include "ash/app_list/home_launcher_animation_info.h"
  14. #include "ash/app_list/model/search/search_model.h"
  15. #include "ash/ash_export.h"
  16. #include "ash/assistant/model/assistant_ui_model_observer.h"
  17. #include "ash/display/window_tree_host_manager.h"
  18. #include "ash/public/cpp/app_list/app_list_controller.h"
  19. #include "ash/public/cpp/app_list/app_list_model_delegate.h"
  20. #include "ash/public/cpp/assistant/controller/assistant_controller_observer.h"
  21. #include "ash/public/cpp/feature_discovery_duration_reporter.h"
  22. #include "ash/public/cpp/keyboard/keyboard_controller_observer.h"
  23. #include "ash/public/cpp/session/session_observer.h"
  24. #include "ash/public/cpp/shelf_types.h"
  25. #include "ash/public/cpp/tablet_mode_observer.h"
  26. #include "ash/public/cpp/wallpaper/wallpaper_controller_observer.h"
  27. #include "ash/shelf/shelf_layout_manager.h"
  28. #include "ash/shell_observer.h"
  29. #include "ash/wm/overview/overview_observer.h"
  30. #include "ash/wm/overview/overview_types.h"
  31. #include "ash/wm/splitview/split_view_observer.h"
  32. #include "base/callback_helpers.h"
  33. #include "base/memory/weak_ptr.h"
  34. #include "base/observer_list.h"
  35. #include "base/scoped_observation.h"
  36. #include "base/time/time.h"
  37. #include "components/sync/model/string_ordinal.h"
  38. #include "third_party/abseil-cpp/absl/types/optional.h"
  39. #include "ui/aura/window_observer.h"
  40. #include "ui/display/types/display_constants.h"
  41. class PrefRegistrySimple;
  42. namespace ui {
  43. class MouseWheelEvent;
  44. } // namespace ui
  45. namespace ash {
  46. class AppListBadgeController;
  47. class AppListBubblePresenter;
  48. class AppListControllerObserver;
  49. class AppListItem;
  50. struct AppListItemMetadata;
  51. class AppListModel;
  52. class AppListModelProvider;
  53. class AppListPresenterImpl;
  54. enum class AppListSortOrder;
  55. // Ash's AppListController owns the AppListModel and implements interface
  56. // functions that allow Chrome to modify and observe the Shelf and AppListModel
  57. // state. It also controls the "home launcher", the tablet mode app list.
  58. class ASH_EXPORT AppListControllerImpl
  59. : public AppListController,
  60. public SessionObserver,
  61. public AppListViewDelegate,
  62. public ShellObserver,
  63. public OverviewObserver,
  64. public SplitViewObserver,
  65. public TabletModeObserver,
  66. public KeyboardControllerObserver,
  67. public WallpaperControllerObserver,
  68. public AssistantStateObserver,
  69. public WindowTreeHostManager::Observer,
  70. public aura::WindowObserver,
  71. public AssistantControllerObserver,
  72. public AssistantUiModelObserver,
  73. public FeatureDiscoveryDurationReporter::ReporterObserver {
  74. public:
  75. AppListControllerImpl();
  76. AppListControllerImpl(const AppListControllerImpl&) = delete;
  77. AppListControllerImpl& operator=(const AppListControllerImpl&) = delete;
  78. ~AppListControllerImpl() override;
  79. enum HomeLauncherTransitionState {
  80. kFinished, // No drag or animation is in progress
  81. kMostlyShown, // The home launcher occupies more than half of the screen
  82. kMostlyHidden, // The home launcher occupies less than half of the screen
  83. };
  84. static void RegisterProfilePrefs(PrefRegistrySimple* registry);
  85. AppListPresenterImpl* fullscreen_presenter() {
  86. return fullscreen_presenter_.get();
  87. }
  88. // AppListController:
  89. void SetClient(AppListClient* client) override;
  90. AppListClient* GetClient() override;
  91. void AddObserver(AppListControllerObserver* observer) override;
  92. void RemoveObserver(AppListControllerObserver* obsever) override;
  93. void SetActiveModel(int profile_id,
  94. AppListModel* model,
  95. SearchModel* search_model) override;
  96. void ClearActiveModel() override;
  97. void NotifyProcessSyncChangesFinished() override;
  98. void DismissAppList() override;
  99. void GetAppInfoDialogBounds(GetAppInfoDialogBoundsCallback callback) override;
  100. void ShowAppList() override;
  101. aura::Window* GetWindow() override;
  102. bool IsVisible(const absl::optional<int64_t>& display_id) override;
  103. bool IsVisible() override;
  104. // SessionObserver:
  105. void OnActiveUserPrefServiceChanged(PrefService* pref_service) override;
  106. void OnSessionStateChanged(session_manager::SessionState state) override;
  107. void OnUserSessionAdded(const AccountId& account_id) override;
  108. // Methods used in ash:
  109. bool GetTargetVisibility(const absl::optional<int64_t>& display_id) const;
  110. void Show(int64_t display_id,
  111. absl::optional<AppListShowSource> show_source,
  112. base::TimeTicks event_time_stamp);
  113. void UpdateYPositionAndOpacity(int y_position_in_screen,
  114. float background_opacity);
  115. void EndDragFromShelf(AppListViewState app_list_state);
  116. void ProcessMouseWheelEvent(const ui::MouseWheelEvent& event);
  117. void ProcessScrollEvent(const ui::ScrollEvent& event);
  118. void UpdateAppListWithNewTemporarySortOrder(
  119. const absl::optional<AppListSortOrder>& new_order,
  120. bool animate,
  121. base::OnceClosure update_position_closure) override;
  122. // In tablet mode, takes the user to the home screen, either by ending
  123. // Overview Mode/Split View Mode or by minimizing the other windows. Returns
  124. // false if there was nothing to do because the given display was already
  125. // "home". Illegal to call in clamshell mode.
  126. bool GoHome(int64_t display_id);
  127. // Toggles app list visibility. In tablet mode, this can only show the app
  128. // list (by hiding any windows that might be shown over the homde launcher).
  129. // |display_id| is the id of display where app list should toggle.
  130. // |show_source| is the source of the event. |event_time_stamp| records the
  131. // event timestamp.
  132. ShelfAction ToggleAppList(int64_t display_id,
  133. AppListShowSource show_source,
  134. base::TimeTicks event_time_stamp);
  135. // Returns whether the home launcher should be visible.
  136. bool ShouldHomeLauncherBeVisible() const;
  137. // AppListViewDelegate:
  138. AppListNotifier* GetNotifier() override;
  139. void StartAssistant() override;
  140. void StartSearch(const std::u16string& raw_query) override;
  141. void StartZeroStateSearch(base::OnceClosure callback,
  142. base::TimeDelta timeout) override;
  143. void OpenSearchResult(const std::string& result_id,
  144. int event_flags,
  145. AppListLaunchedFrom launched_from,
  146. AppListLaunchType launch_type,
  147. int suggestion_index,
  148. bool launch_as_default) override;
  149. void InvokeSearchResultAction(const std::string& result_id,
  150. SearchResultActionType action) override;
  151. using GetContextMenuModelCallback =
  152. AppListViewDelegate::GetContextMenuModelCallback;
  153. void GetSearchResultContextMenuModel(
  154. const std::string& result_id,
  155. GetContextMenuModelCallback callback) override;
  156. void ViewShown(int64_t display_id) override;
  157. bool AppListTargetVisibility() const override;
  158. void ViewClosing() override;
  159. const std::vector<SkColor>& GetWallpaperProminentColors() override;
  160. void ActivateItem(const std::string& id,
  161. int event_flags,
  162. AppListLaunchedFrom launched_from) override;
  163. void GetContextMenuModel(const std::string& id,
  164. AppListItemContext item_context,
  165. GetContextMenuModelCallback callback) override;
  166. ui::ImplicitAnimationObserver* GetAnimationObserver(
  167. AppListViewState target_state) override;
  168. void ShowWallpaperContextMenu(const gfx::Point& onscreen_location,
  169. ui::MenuSourceType source_type) override;
  170. bool KeyboardTraversalEngaged() override;
  171. bool CanProcessEventsOnApplistViews() override;
  172. bool ShouldDismissImmediately() override;
  173. int GetTargetYForAppListHide(aura::Window* root_window) override;
  174. AssistantViewDelegate* GetAssistantViewDelegate() override;
  175. void OnSearchResultVisibilityChanged(const std::string& id,
  176. bool visibility) override;
  177. void MaybeIncreaseSuggestedContentInfoShownCount() override;
  178. bool IsAssistantAllowedAndEnabled() const override;
  179. bool ShouldShowSuggestedContentInfo() const override;
  180. void MarkSuggestedContentInfoDismissed() override;
  181. void OnStateTransitionAnimationCompleted(
  182. AppListViewState state,
  183. bool was_animation_interrupted) override;
  184. int AdjustAppListViewScrollOffset(int offset, ui::EventType type) override;
  185. void LoadIcon(const std::string& app_id) override;
  186. bool HasValidProfile() const override;
  187. bool ShouldHideContinueSection() const override;
  188. void SetHideContinueSection(bool hide) override;
  189. void CommitTemporarySortOrder() override;
  190. void GetAppLaunchedMetricParams(
  191. AppLaunchedMetricParams* metric_params) override;
  192. gfx::Rect SnapBoundsToDisplayEdge(const gfx::Rect& bounds) override;
  193. AppListState GetCurrentAppListPage() const override;
  194. void OnAppListPageChanged(AppListState page) override;
  195. AppListViewState GetAppListViewState() const override;
  196. void OnViewStateChanged(AppListViewState state) override;
  197. int GetShelfSize() override;
  198. bool IsInTabletMode() override;
  199. AppListColorProviderImpl* GetColorProvider();
  200. // Notifies observers of AppList visibility changes.
  201. void OnVisibilityChanged(bool visible, int64_t display_id);
  202. void OnVisibilityWillChange(bool visible, int64_t display_id);
  203. // ShellObserver:
  204. void OnShelfAlignmentChanged(aura::Window* root_window,
  205. ShelfAlignment old_alignment) override;
  206. void OnShellDestroying() override;
  207. // OverviewObserver:
  208. void OnOverviewModeStarting() override;
  209. void OnOverviewModeStartingAnimationComplete(bool canceled) override;
  210. void OnOverviewModeEnding(OverviewSession* session) override;
  211. void OnOverviewModeEnded() override;
  212. void OnOverviewModeEndingAnimationComplete(bool canceled) override;
  213. // SplitViewObserver:
  214. void OnSplitViewStateChanged(SplitViewController::State previous_state,
  215. SplitViewController::State state) override;
  216. // TabletModeObserver:
  217. void OnTabletModeStarted() override;
  218. void OnTabletModeEnded() override;
  219. // KeyboardControllerObserver:
  220. void OnKeyboardVisibilityChanged(bool is_visible) override;
  221. // WallpaperControllerObserver:
  222. void OnWallpaperColorsChanged() override;
  223. void OnWallpaperPreviewStarted() override;
  224. void OnWallpaperPreviewEnded() override;
  225. // AssistantStateObserver:
  226. void OnAssistantStatusChanged(assistant::AssistantStatus status) override;
  227. void OnAssistantSettingsEnabled(bool enabled) override;
  228. void OnAssistantFeatureAllowedChanged(
  229. assistant::AssistantAllowedState state) override;
  230. // WindowTreeHostManager::Observer:
  231. void OnDisplayConfigurationChanged() override;
  232. // aura::WindowObserver:
  233. void OnWindowVisibilityChanging(aura::Window* window, bool visible) override;
  234. void OnWindowDestroyed(aura::Window* window) override;
  235. // AssistantControllerObserver:
  236. void OnAssistantReady() override;
  237. // AssistantUiModelObserver:
  238. void OnUiVisibilityChanged(
  239. AssistantVisibility new_visibility,
  240. AssistantVisibility old_visibility,
  241. absl::optional<AssistantEntryPoint> entry_point,
  242. absl::optional<AssistantExitPoint> exit_point) override;
  243. // Gets the home screen window, if available, or null if the home screen
  244. // window is being hidden for effects (e.g. when dragging windows or
  245. // previewing the wallpaper).
  246. aura::Window* GetHomeScreenWindow() const;
  247. // Scales the home launcher view maintaining the view center point, and
  248. // updates its opacity. If |callback| is non-null, the update should be
  249. // animated, and the |callback| should be called with the animation settings.
  250. // |animation_info| - Information about the transition trigger that will be
  251. // used to report animation metrics. Should be set only if |callback| is
  252. // not null (otherwise the transition will not be animated).
  253. using UpdateAnimationSettingsCallback =
  254. base::RepeatingCallback<void(ui::ScopedLayerAnimationSettings* settings)>;
  255. void UpdateScaleAndOpacityForHomeLauncher(
  256. float scale,
  257. float opacity,
  258. absl::optional<HomeLauncherAnimationInfo> animation_info,
  259. UpdateAnimationSettingsCallback callback);
  260. // Disables background blur in home screen UI while the returned
  261. // ScopedClosureRunner is in scope.
  262. base::ScopedClosureRunner DisableHomeScreenBackgroundBlur();
  263. // Called when the HomeLauncher positional animation has completed.
  264. void OnHomeLauncherAnimationComplete(bool shown, int64_t display_id);
  265. // Called when the HomeLauncher has changed its position on the screen,
  266. // during either an animation or a drag.
  267. void OnHomeLauncherPositionChanged(int percent_shown, int64_t display_id);
  268. // True if home screen is visible.
  269. bool IsHomeScreenVisible();
  270. // Called when a window starts/ends dragging. If the home screen is shown, we
  271. // should hide it during dragging a window and reshow it when the drag ends.
  272. void OnWindowDragStarted();
  273. // If |animate| is true, scale-in-to-show home screen if home screen should
  274. // be shown after drag ends.
  275. void OnWindowDragEnded(bool animate);
  276. bool onscreen_keyboard_shown() const { return onscreen_keyboard_shown_; }
  277. // Performs the 'back' action for the active page.
  278. void Back();
  279. void SetKeyboardTraversalMode(bool engaged);
  280. // Returns whether the assistant page is showing (either in bubble app list or
  281. // fullscreen app list).
  282. bool IsShowingEmbeddedAssistantUI() const;
  283. // Sets up `close_assistant_ui_runner_` to close the assistant.
  284. void ScheduleCloseAssistant();
  285. // Runs `close_assistant_ui_runner_` when it is non-null.
  286. void MaybeCloseAssistant();
  287. // Get updated app list view state after dragging from shelf.
  288. AppListViewState CalculateStateAfterShelfDrag(
  289. const ui::LocatedEvent& event_in_screen,
  290. float launcher_above_shelf_bottom_amount) const;
  291. using StateTransitionAnimationCallback =
  292. base::RepeatingCallback<void(AppListViewState)>;
  293. void SetStateTransitionAnimationCallbackForTesting(
  294. StateTransitionAnimationCallback callback);
  295. using HomeLauncherAnimationCallback =
  296. base::RepeatingCallback<void(bool shown)>;
  297. void SetHomeLauncherAnimationCallbackForTesting(
  298. HomeLauncherAnimationCallback callback);
  299. AppListBubblePresenter* bubble_presenter_for_test() {
  300. return bubble_presenter_.get();
  301. }
  302. void RecordShelfAppLaunched();
  303. // Updates which container the launcher window should be in.
  304. void UpdateLauncherContainer(
  305. absl::optional<int64_t> display_id = absl::nullopt);
  306. // Gets the container which should contain the AppList.
  307. int GetContainerId() const;
  308. // Returns whether the launcher should show behinds apps or infront of them.
  309. bool ShouldLauncherShowBehindApps() const;
  310. // Returns the parent window of the applist for a |display_id|.
  311. aura::Window* GetContainerForDisplayId(
  312. absl::optional<int64_t> display_id = absl::nullopt);
  313. // Methods for recording the state of the app list before it changes in order
  314. // to record metrics.
  315. void RecordAppListState();
  316. AppListBadgeController* badge_controller_for_test() {
  317. return badge_controller_.get();
  318. }
  319. private:
  320. // Convenience methods for getting models from `model_provider_`.
  321. AppListModel* GetModel();
  322. SearchModel* GetSearchModel();
  323. std::unique_ptr<AppListItem> CreateAppListItem(
  324. std::unique_ptr<AppListItemMetadata> metadata);
  325. // Update the visibility of Assistant functionality.
  326. void UpdateAssistantVisibility();
  327. int64_t GetDisplayIdToShowAppListOn();
  328. void ResetHomeLauncherIfShown();
  329. void ShowHomeScreen();
  330. // Updates the visibility of the home screen based on e.g. if the device is
  331. // in overview mode.
  332. void UpdateHomeScreenVisibility();
  333. // Returns true if home screen should be shown based on the current
  334. // configuration.
  335. bool ShouldShowHomeScreen() const;
  336. // Returns true if the bubble app list should be shown (instead of the
  337. // fullscreen app list), based on tablet mode state and the feature flag.
  338. bool ShouldShowAppListBubble() const;
  339. // Updates home launcher scale and opacity when the overview mode state
  340. // changes. `show_home_launcher` - whether the home launcher should be shown.
  341. // `animate` - whether the transition should be animated.
  342. void UpdateForOverviewModeChange(bool show_home_launcher, bool animate);
  343. // Shuts down the AppListControllerImpl, removing itself as an observer.
  344. void Shutdown();
  345. // Record the app launch for AppListAppLaunchedV2 metric.
  346. void RecordAppLaunched(AppListLaunchedFrom launched_from);
  347. // Updates the window that is tracked as |tracked_app_window_|.
  348. void UpdateTrackedAppWindow();
  349. // Responsible for starting or stopping |smoothness_tracker_|.
  350. void StartTrackingAnimationSmoothness(int64_t display_id);
  351. void RecordAnimationSmoothness();
  352. // Called when all the window minimize animations triggered by a tablet mode
  353. // "Go Home" have ended. |display_id| is the home screen display ID.
  354. void OnGoHomeWindowAnimationsEnded(int64_t display_id);
  355. // FeatureDiscoveryDurationReporter::ReporterObserver:
  356. void OnReporterActivated() override;
  357. // Whether the home launcher is
  358. // * being shown (either through an animation or a drag)
  359. // * being hidden (either through an animation or a drag)
  360. // * not animating nor being dragged.
  361. // In the case where the home launcher is being dragged, the gesture can
  362. // reverse direction at any point during the drag, in which case the only
  363. // information given by "showing" versus "hiding" is the starting point of
  364. // the drag and the assumed final state (which won't be accurate if the
  365. // gesture is reversed).
  366. HomeLauncherTransitionState home_launcher_transition_state_ = kFinished;
  367. AppListClient* client_ = nullptr;
  368. // Tracks active app list and search models to app list UI stack. It can be
  369. // accessed outside AppListModelControllerImpl using
  370. // `AppListModelController::Get()`.
  371. std::unique_ptr<AppListModelProvider> model_provider_;
  372. // Used to fetch colors from AshColorProvider. Should be destructed after
  373. // |presenter_| and UI.
  374. AppListColorProviderImpl color_provider_;
  375. // Manages the fullscreen/peeking launcher and the tablet mode home launcher.
  376. // |fullscreen_presenter_| should be put below |client_| and |model_| to
  377. // prevent a crash in destruction.
  378. std::unique_ptr<AppListPresenterImpl> fullscreen_presenter_;
  379. // Manages the clamshell launcher bubble. Always exists, even when feature
  380. // ProductivityLauncher is disabled, to allow unit tests to turn the feature
  381. // on and off within the test body.
  382. std::unique_ptr<AppListBubblePresenter> bubble_presenter_;
  383. // Tracks the current page shown in the app list view (tracked for the
  384. // fullscreen presenter).
  385. AppListState app_list_page_ = AppListState::kInvalidState;
  386. // Tracks the current state of `AppListView` (tracked for the fullscreen
  387. // presenter)
  388. AppListViewState app_list_view_state_ = AppListViewState::kClosed;
  389. // True if the on-screen keyboard is shown.
  390. bool onscreen_keyboard_shown_ = false;
  391. // True if the most recent event handled by |presenter_| was a key event.
  392. bool keyboard_traversal_engaged_ = false;
  393. // True if Shutdown() has been called.
  394. bool is_shutdown_ = false;
  395. // Whether to immediately dismiss the AppListView.
  396. bool should_dismiss_immediately_ = false;
  397. // The last target visibility change and its display id.
  398. bool last_target_visible_ = false;
  399. int64_t last_target_visible_display_id_ = display::kInvalidDisplayId;
  400. // The last visibility change and its display id.
  401. bool last_visible_ = false;
  402. int64_t last_visible_display_id_ = display::kInvalidDisplayId;
  403. // Used in mojo callings to specify the profile whose app list data is
  404. // read/written by Ash side through IPC. Notice that in multi-profile mode,
  405. // each profile has its own AppListModelUpdater to manipulate app list items.
  406. int profile_id_ = kAppListInvalidProfileID;
  407. // Used when tablet mode is active to track the MRU window among the windows
  408. // that were obscuring the home launcher when the home launcher visibility was
  409. // last calculated.
  410. // This window changing it's visibility to false is used as a signal that the
  411. // home launcher visibility should be recalculated.
  412. aura::Window* tracked_app_window_ = nullptr;
  413. // A callback that can be registered by a test to wait for the app list state
  414. // transition animation to finish.
  415. StateTransitionAnimationCallback state_transition_animation_callback_;
  416. // A callback that can be registered by a test to wait for the home launcher
  417. // visibility animation to finish. Should only be used in tablet mode.
  418. HomeLauncherAnimationCallback home_launcher_animation_callback_;
  419. // The AppListViewState at the moment it was recorded, used to record app
  420. // launching metrics. This allows an accurate AppListViewState to be recorded
  421. // before AppListViewState changes.
  422. absl::optional<AppListViewState> recorded_app_list_view_state_;
  423. // Whether the applist was shown at the moment it was recorded, used to record
  424. // app launching metrics. This is recorded because AppList visibility can
  425. // change before the metric is recorded.
  426. absl::optional<bool> recorded_app_list_visibility_;
  427. // The last time the app list was shown.
  428. absl::optional<base::TimeTicks> last_show_timestamp_;
  429. // ScopedClosureRunner which while in scope keeps background blur in home
  430. // screen (in particular, apps container suggestion chips background)
  431. // disabled. Set while home screen transitions are in progress.
  432. absl::optional<base::ScopedClosureRunner> home_screen_blur_disabler_;
  433. base::ObserverList<AppListControllerObserver> observers_;
  434. // Sub-controller to handle app item badges. Must be constructed after
  435. // `model_provider_`.
  436. std::unique_ptr<AppListBadgeController> badge_controller_;
  437. // Whether the wallpaper is being previewed. The home screen should be hidden
  438. // during wallpaper preview.
  439. bool in_wallpaper_preview_ = false;
  440. // Whether we're currently in a window dragging process.
  441. bool in_window_dragging_ = false;
  442. // Whether a session was ever set ACTIVE for the app list.
  443. bool has_session_started_ = false;
  444. // The last overview mode exit type - cached when the overview exit starts, so
  445. // it can be used to decide how to update home screen when overview mode exit
  446. // animations are finished (at which point this information will not be
  447. // available).
  448. absl::optional<OverviewEnterExitType> overview_exit_type_;
  449. // Responsible for recording smoothness related UMA stats for home screen
  450. // animations.
  451. absl::optional<ui::ThroughputTracker> smoothness_tracker_;
  452. // Used for closing the Assistant ui in the asynchronous way.
  453. base::ScopedClosureRunner close_assistant_ui_runner_;
  454. base::ScopedObservation<SplitViewController, SplitViewObserver>
  455. split_view_observation_{this};
  456. base::WeakPtrFactory<AppListControllerImpl> weak_ptr_factory_{this};
  457. };
  458. } // namespace ash
  459. #endif // ASH_APP_LIST_APP_LIST_CONTROLLER_IMPL_H_