| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ASH_COMMON_SHELF_SHELF_ITEM_DELEGATE_H_ | 5 #ifndef ASH_COMMON_SHELF_SHELF_ITEM_DELEGATE_H_ |
| 6 #define ASH_COMMON_SHELF_SHELF_ITEM_DELEGATE_H_ | 6 #define ASH_COMMON_SHELF_SHELF_ITEM_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> |
| 9 |
| 8 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| 9 #include "ash/public/cpp/shelf_application_menu_item.h" | 11 #include "ash/public/cpp/shelf_application_menu_item.h" |
| 10 #include "ash/public/cpp/shelf_types.h" | 12 #include "ash/public/cpp/shelf_types.h" |
| 11 #include "ui/events/event_constants.h" | 13 #include "ui/events/event_constants.h" |
| 12 | 14 |
| 13 namespace ash { | 15 namespace ash { |
| 14 | 16 |
| 15 // Delegate for the ShelfItem. | 17 // Delegate for the ShelfItem. |
| 16 class ASH_EXPORT ShelfItemDelegate { | 18 class ASH_EXPORT ShelfItemDelegate { |
| 17 public: | 19 public: |
| (...skipping 10 matching lines...) Expand all Loading... |
| 28 int64_t display_id, | 30 int64_t display_id, |
| 29 ShelfLaunchSource source) = 0; | 31 ShelfLaunchSource source) = 0; |
| 30 | 32 |
| 31 // A helper to call ItemSelected with a source and default arguments. | 33 // A helper to call ItemSelected with a source and default arguments. |
| 32 ShelfAction ItemSelectedBySource(ShelfLaunchSource source); | 34 ShelfAction ItemSelectedBySource(ShelfLaunchSource source); |
| 33 | 35 |
| 34 // Returns any application menu items that should appear for this shelf item. | 36 // Returns any application menu items that should appear for this shelf item. |
| 35 // |event_flags| specifies the flags of the event which triggered this menu. | 37 // |event_flags| specifies the flags of the event which triggered this menu. |
| 36 virtual ShelfAppMenuItemList GetAppMenuItems(int event_flags) = 0; | 38 virtual ShelfAppMenuItemList GetAppMenuItems(int event_flags) = 0; |
| 37 | 39 |
| 40 // Called on invocation of a shelf item's application menu command. |
| 41 virtual void ExecuteCommand(uint32_t command_id, int event_flags) = 0; |
| 42 |
| 38 // Closes all windows associated with this item. | 43 // Closes all windows associated with this item. |
| 39 virtual void Close() = 0; | 44 virtual void Close() = 0; |
| 40 | 45 |
| 41 DISALLOW_COPY_AND_ASSIGN(ShelfItemDelegate); | 46 DISALLOW_COPY_AND_ASSIGN(ShelfItemDelegate); |
| 42 }; | 47 }; |
| 43 | 48 |
| 44 } // namespace ash | 49 } // namespace ash |
| 45 | 50 |
| 46 #endif // ASH_COMMON_SHELF_SHELF_ITEM_DELEGATE_H_ | 51 #endif // ASH_COMMON_SHELF_SHELF_ITEM_DELEGATE_H_ |
| OLD | NEW |