Avi Drissman | 3a215d1e | 2022-09-07 19:43:09 | [diff] [blame] | 1 | // Copyright 2013 The Chromium Authors |
James Cook | b0bf8e8 | 2017-04-09 17:01:44 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef ASH_SHELF_SHELF_WINDOW_WATCHER_ITEM_DELEGATE_H_ |
| 6 | #define ASH_SHELF_SHELF_WINDOW_WATCHER_ITEM_DELEGATE_H_ |
| 7 | |
| 8 | #include "ash/public/cpp/shelf_item_delegate.h" |
Arthur Sonzogni | 834e018f | 2023-04-22 10:20:02 | [diff] [blame] | 9 | #include "base/memory/raw_ptr.h" |
James Cook | b0bf8e8 | 2017-04-09 17:01:44 | [diff] [blame] | 10 | |
varkha | ae5decc | 2017-05-26 20:05:38 | [diff] [blame] | 11 | namespace aura { |
| 12 | class Window; |
| 13 | } |
James Cook | b0bf8e8 | 2017-04-09 17:01:44 | [diff] [blame] | 14 | |
varkha | ae5decc | 2017-05-26 20:05:38 | [diff] [blame] | 15 | namespace ash { |
James Cook | b0bf8e8 | 2017-04-09 17:01:44 | [diff] [blame] | 16 | |
| 17 | // ShelfItemDelegate for the items created by ShelfWindowWatcher, for example: |
| 18 | // The Chrome OS settings window, task manager window, and panel windows. |
| 19 | class ShelfWindowWatcherItemDelegate : public ShelfItemDelegate { |
| 20 | public: |
varkha | ae5decc | 2017-05-26 20:05:38 | [diff] [blame] | 21 | ShelfWindowWatcherItemDelegate(const ShelfID& id, aura::Window* window); |
Peter Boström | ec31a04 | 2021-09-16 23:37:34 | [diff] [blame] | 22 | |
| 23 | ShelfWindowWatcherItemDelegate(const ShelfWindowWatcherItemDelegate&) = |
| 24 | delete; |
| 25 | ShelfWindowWatcherItemDelegate& operator=( |
| 26 | const ShelfWindowWatcherItemDelegate&) = delete; |
| 27 | |
James Cook | b0bf8e8 | 2017-04-09 17:01:44 | [diff] [blame] | 28 | ~ShelfWindowWatcherItemDelegate() override; |
| 29 | |
| 30 | private: |
| 31 | // ShelfItemDelegate overrides: |
| 32 | void ItemSelected(std::unique_ptr<ui::Event> event, |
| 33 | int64_t display_id, |
| 34 | ShelfLaunchSource source, |
Ahmed Fakhry | 1b6ea0b | 2020-07-09 01:45:24 | [diff] [blame] | 35 | ItemSelectedCallback callback, |
| 36 | const ItemFilterPredicate& filter_predicate) override; |
Mike Wasserman | 3bfabb19 | 2019-05-17 01:08:34 | [diff] [blame] | 37 | void GetContextMenu(int64_t display_id, |
| 38 | GetContextMenuCallback callback) override; |
Michael Wasserman | 47bf178 | 2017-08-18 23:17:10 | [diff] [blame] | 39 | void ExecuteCommand(bool from_context_menu, |
| 40 | int64_t command_id, |
| 41 | int32_t event_flags, |
| 42 | int64_t display_id) override; |
James Cook | b0bf8e8 | 2017-04-09 17:01:44 | [diff] [blame] | 43 | void Close() override; |
| 44 | |
James Cook | b0bf8e8 | 2017-04-09 17:01:44 | [diff] [blame] | 45 | // The window associated with this item. Not owned. |
Bartek Nowierski | deb7584 | 2023-12-27 02:32:42 | [diff] [blame] | 46 | raw_ptr<aura::Window> window_; |
James Cook | b0bf8e8 | 2017-04-09 17:01:44 | [diff] [blame] | 47 | }; |
| 48 | |
| 49 | } // namespace ash |
| 50 | |
| 51 | #endif // ASH_SHELF_SHELF_WINDOW_WATCHER_ITEM_DELEGATE_H_ |