folder_background_view.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Copyright 2014 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_FOLDER_BACKGROUND_VIEW_H_
  5. #define ASH_APP_LIST_VIEWS_FOLDER_BACKGROUND_VIEW_H_
  6. #include "ui/views/view.h"
  7. namespace ash {
  8. class AppListFolderView;
  9. // An invisible background view of the folder in fullscreen app list. It is used
  10. // to close folder when the user clicks/taps outside the opened folder.
  11. class FolderBackgroundView : public views::View {
  12. public:
  13. explicit FolderBackgroundView(AppListFolderView* folder_view);
  14. FolderBackgroundView(const FolderBackgroundView&) = delete;
  15. FolderBackgroundView& operator=(const FolderBackgroundView&) = delete;
  16. ~FolderBackgroundView() override;
  17. void set_folder_view(AppListFolderView* folder_view) {
  18. folder_view_ = folder_view;
  19. }
  20. // views::View:
  21. const char* GetClassName() const override;
  22. private:
  23. // views::View:
  24. bool OnMousePressed(const ui::MouseEvent& event) override;
  25. void OnGestureEvent(ui::GestureEvent* event) override;
  26. // Handles mouse click event or gesture tap event.
  27. void HandleClickOrTap();
  28. AppListFolderView* folder_view_;
  29. };
  30. } // namespace ash
  31. #endif // ASH_APP_LIST_VIEWS_FOLDER_BACKGROUND_VIEW_H_