window_restore_util.h 1023 B

1234567891011121314151617181920212223242526272829
  1. // Copyright 2021 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_WM_WINDOW_RESTORE_WINDOW_RESTORE_UTIL_H_
  5. #define ASH_WM_WINDOW_RESTORE_WINDOW_RESTORE_UTIL_H_
  6. #include "components/app_restore/window_info.h"
  7. namespace aura {
  8. class Window;
  9. }
  10. namespace ash {
  11. // Builds the WindowInfo for `window`. Optionally passes `activation_index`,
  12. // which is used to set `WindowInfo.activation_index` if it has value.
  13. // Otherwise, `WindowInfo.activation_index` will be calculated from
  14. // `mru_windows`. If `for_saved_desks` this was called from a feature which
  15. // saves desks, and we need to add extra information such as the app title.
  16. std::unique_ptr<app_restore::WindowInfo> BuildWindowInfo(
  17. aura::Window* window,
  18. absl::optional<int> activation_index,
  19. bool for_saved_desks,
  20. const std::vector<aura::Window*>& mru_windows);
  21. } // namespace ash
  22. #endif // ASH_WM_WINDOW_RESTORE_WINDOW_RESTORE_UTIL_H_