shelf_item_delegate.cc 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright 2017 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "ash/public/cpp/shelf_item_delegate.h"
  5. #include "ui/base/models/simple_menu_model.h"
  6. namespace ash {
  7. ShelfItemDelegate::ShelfItemDelegate(const ShelfID& shelf_id)
  8. : shelf_id_(shelf_id) {}
  9. ShelfItemDelegate::~ShelfItemDelegate() = default;
  10. void ShelfItemDelegate::ItemSelected(
  11. std::unique_ptr<ui::Event> event,
  12. int64_t display_id,
  13. ShelfLaunchSource source,
  14. ItemSelectedCallback callback,
  15. const ItemFilterPredicate& filter_predicate) {
  16. std::move(callback).Run(SHELF_ACTION_NONE, {});
  17. }
  18. ShelfItemDelegate::AppMenuItems ShelfItemDelegate::GetAppMenuItems(
  19. int event_flags,
  20. const ItemFilterPredicate& filter_predicate) {
  21. return {};
  22. }
  23. void ShelfItemDelegate::GetContextMenu(int64_t display_id,
  24. GetContextMenuCallback callback) {
  25. // Supplying null will cause ShelfView to show a default context menu.
  26. std::move(callback).Run(nullptr);
  27. }
  28. AppWindowShelfItemController*
  29. ShelfItemDelegate::AsAppWindowShelfItemController() {
  30. return nullptr;
  31. }
  32. } // namespace ash