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" |
James Cook | b0bf8e8 | 2017-04-09 17:01:44 | [diff] [blame] | 9 | |
varkha | ae5decc | 2017-05-26 20:05:38 | [diff] [blame] | 10 | namespace aura { |
| 11 | class Window; |
| 12 | } |
James Cook | b0bf8e8 | 2017-04-09 17:01:44 | [diff] [blame] | 13 | |
varkha | ae5decc | 2017-05-26 20:05:38 | [diff] [blame] | 14 | namespace ash { |
James Cook | b0bf8e8 | 2017-04-09 17:01:44 | [diff] [blame] | 15 | |
| 16 | // ShelfItemDelegate for the items created by ShelfWindowWatcher, for example: |
| 17 | // The Chrome OS settings window, task manager window, and panel windows. |
| 18 | class ShelfWindowWatcherItemDelegate : public ShelfItemDelegate { |
| 19 | public: |
varkha | ae5decc | 2017-05-26 20:05:38 | [diff] [blame] | 20 | ShelfWindowWatcherItemDelegate(const ShelfID& id, aura::Window* window); |
Peter Boström | ec31a04 | 2021-09-16 23:37:34 | [diff] [blame] | 21 | |
| 22 | ShelfWindowWatcherItemDelegate(const ShelfWindowWatcherItemDelegate&) = |
| 23 | delete; |
| 24 | ShelfWindowWatcherItemDelegate& operator=( |
| 25 | const ShelfWindowWatcherItemDelegate&) = delete; |
| 26 | |
James Cook | b0bf8e8 | 2017-04-09 17:01:44 | [diff] [blame] | 27 | ~ShelfWindowWatcherItemDelegate() override; |
| 28 | |
| 29 | private: |
| 30 | // ShelfItemDelegate overrides: |
| 31 | void ItemSelected(std::unique_ptr<ui::Event> event, |
| 32 | int64_t display_id, |
| 33 | ShelfLaunchSource source, |
Ahmed Fakhry | 1b6ea0b | 2020-07-09 01:45:24 | [diff] [blame] | 34 | ItemSelectedCallback callback, |
| 35 | const ItemFilterPredicate& filter_predicate) override; |
Mike Wasserman | 3bfabb19 | 2019-05-17 01:08:34 | [diff] [blame] | 36 | void GetContextMenu(int64_t display_id, |
| 37 | GetContextMenuCallback callback) override; |
Michael Wasserman | 47bf178 | 2017-08-18 23:17:10 | [diff] [blame] | 38 | void ExecuteCommand(bool from_context_menu, |
| 39 | int64_t command_id, |
| 40 | int32_t event_flags, |
| 41 | int64_t display_id) override; |
James Cook | b0bf8e8 | 2017-04-09 17:01:44 | [diff] [blame] | 42 | void Close() override; |
| 43 | |
James Cook | b0bf8e8 | 2017-04-09 17:01:44 | [diff] [blame] | 44 | // The window associated with this item. Not owned. |
varkha | ae5decc | 2017-05-26 20:05:38 | [diff] [blame] | 45 | aura::Window* window_; |
James Cook | b0bf8e8 | 2017-04-09 17:01:44 | [diff] [blame] | 46 | }; |
| 47 | |
| 48 | } // namespace ash |
| 49 | |
| 50 | #endif // ASH_SHELF_SHELF_WINDOW_WATCHER_ITEM_DELEGATE_H_ |