app_list_bubble_search_page.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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_APP_LIST_VIEWS_APP_LIST_BUBBLE_SEARCH_PAGE_H_
  5. #define ASH_APP_LIST_VIEWS_APP_LIST_BUBBLE_SEARCH_PAGE_H_
  6. #include "ash/ash_export.h"
  7. #include "base/memory/weak_ptr.h"
  8. #include "ui/base/metadata/metadata_header_macros.h"
  9. #include "ui/views/view.h"
  10. namespace ui {
  11. class Layer;
  12. }
  13. namespace ash {
  14. class AppListViewDelegate;
  15. class ProductivityLauncherSearchView;
  16. class SearchBoxView;
  17. class SearchResultPageDialogController;
  18. // The search results page for the app list bubble / clamshell launcher.
  19. // Contains a scrolling list of search results. Does not include the search box,
  20. // which is owned by a parent view.
  21. class ASH_EXPORT AppListBubbleSearchPage : public views::View {
  22. public:
  23. METADATA_HEADER(AppListBubbleSearchPage);
  24. AppListBubbleSearchPage(AppListViewDelegate* view_delegate,
  25. SearchResultPageDialogController* dialog_controller,
  26. SearchBoxView* search_box_view);
  27. AppListBubbleSearchPage(const AppListBubbleSearchPage&) = delete;
  28. AppListBubbleSearchPage& operator=(const AppListBubbleSearchPage&) = delete;
  29. ~AppListBubbleSearchPage() override;
  30. // Starts the animation for showing this page, coming from another page.
  31. void AnimateShowPage();
  32. // Starts the animation for hiding this page, going to another page.
  33. void AnimateHidePage();
  34. // Aborts all layer animations.
  35. void AbortAllAnimations();
  36. ProductivityLauncherSearchView* search_view() { return search_view_; }
  37. // Which layer animates is an implementation detail.
  38. ui::Layer* GetPageAnimationLayerForTest();
  39. private:
  40. // Owned by view hierarchy.
  41. ProductivityLauncherSearchView* search_view_ = nullptr;
  42. base::WeakPtrFactory<AppListBubbleSearchPage> weak_factory_{this};
  43. };
  44. } // namespace ash
  45. #endif // ASH_APP_LIST_VIEWS_APP_LIST_BUBBLE_SEARCH_PAGE_H_