123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- // Copyright 2021 The Chromium Authors. All rights reserved.
- // Use of this source code is governed by a BSD-style license that can be
- // found in the LICENSE file.
- #ifndef ASH_APP_LIST_APP_LIST_PRESENTER_EVENT_FILTER_H_
- #define ASH_APP_LIST_APP_LIST_PRESENTER_EVENT_FILTER_H_
- #include "ash/ash_export.h"
- #include "ui/events/event_handler.h"
- namespace ui {
- class LocatedEvent;
- } // namespace ui
- namespace ash {
- class AppListControllerImpl;
- class AppListPresenterImpl;
- class AppListView;
- // Listens for mouse clicks and taps outside the app list to close the UI when
- // necessary. Used by the peeking/fullscreen launcher.
- class ASH_EXPORT AppListPresenterEventFilter : public ui::EventHandler {
- public:
- AppListPresenterEventFilter(AppListControllerImpl* controller,
- AppListPresenterImpl* presenter,
- AppListView* view);
- AppListPresenterEventFilter(const AppListPresenterEventFilter&) = delete;
- AppListPresenterEventFilter& operator=(const AppListPresenterEventFilter&) =
- delete;
- ~AppListPresenterEventFilter() override;
- // ui::EventHandler overrides:
- void OnMouseEvent(ui::MouseEvent* event) override;
- void OnGestureEvent(ui::GestureEvent* event) override;
- void OnKeyEvent(ui::KeyEvent* event) override;
- private:
- void ProcessLocatedEvent(ui::LocatedEvent* event);
- AppListControllerImpl* const controller_;
- AppListPresenterImpl* const presenter_;
- AppListView* const view_;
- };
- } // namespace ash
- #endif // ASH_APP_LIST_APP_LIST_PRESENTER_EVENT_FILTER_H_
|