Chromium Code Reviews| Index: ash/common/shelf/shelf_item_delegate.h |
| diff --git a/ash/common/shelf/shelf_item_delegate.h b/ash/common/shelf/shelf_item_delegate.h |
| index 43605db24411b7426b6bafa0293ccc6141350283..52e6b46bdc55e04271f633ee40d38d20e7d9d1b1 100644 |
| --- a/ash/common/shelf/shelf_item_delegate.h |
| +++ b/ash/common/shelf/shelf_item_delegate.h |
| @@ -7,40 +7,27 @@ |
| #include "ash/ash_export.h" |
| #include "ash/public/cpp/shelf_application_menu_item.h" |
| - |
| -namespace ui { |
| -class Event; |
| -} |
| +#include "ash/public/cpp/shelf_types.h" |
| +#include "ui/events/event_constants.h" |
| namespace ash { |
| // Delegate for the ShelfItem. |
| class ASH_EXPORT ShelfItemDelegate { |
| public: |
| - // The return type for the ShelfItemDelegate::ItemSelected method. |
| - enum PerformedAction { |
| - // No action was taken. |
| - kNoAction, |
| - // A new window was created. |
| - kNewWindowCreated, |
| - // An existing window which was not currently active was activated. |
| - kExistingWindowActivated, |
| - // The currently active window was minimized. |
| - kExistingWindowMinimized, |
| - // The app list launcher menu was shown. |
| - kAppListMenuShown, |
| - }; |
| - |
| - virtual ~ShelfItemDelegate() {} |
| - |
| - // Invoked when the user clicks on a window entry in the launcher. |
| - // |event| is the click event. The |event| is dispatched by a view |
| - // and has an instance of |views::View| as the event target |
| - // but not |aura::Window|. If the |event| is of type KeyEvent, it is assumed |
| - // that this was triggered by keyboard action (Alt+<number>) and special |
| - // handling might happen. |
| + ShelfItemDelegate(); |
| + virtual ~ShelfItemDelegate(); |
| + |
| + // Called when the user selects a shelf item. The event type and flags, the |
| + // relevant display id, and the source of the selection should be provided if |
| + // they are known to the caller; as some subclasses use these arguments. |
| + // Defaults: (ET_UNKNOWN, EF_NONE, kInvalidDisplayId, LAUNCH_FROM_UNKNOWN) |
| // Returns the action performed by selecting the item. |
| - virtual PerformedAction ItemSelected(const ui::Event& event) = 0; |
| + ShelfAction ItemSelectedBySource(ShelfLaunchSource source); |
|
James Cook
2017/02/16 00:08:18
nit: I would put this above the comment, or below
msw
2017/02/16 00:12:20
Done.
|
| + virtual ShelfAction ItemSelected(ui::EventType event_type, |
| + int event_flags, |
| + int64_t display_id, |
| + ShelfLaunchSource source) = 0; |
| // Returns any application menu items that should appear for this shelf item. |
| // |event_flags| specifies the flags of the event which triggered this menu. |
| @@ -48,6 +35,8 @@ class ASH_EXPORT ShelfItemDelegate { |
| // Closes all windows associated with this item. |
| virtual void Close() = 0; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ShelfItemDelegate); |
| }; |
| } // namespace ash |