Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Side by Side Diff: ash/common/shelf/app_list_shelf_item_delegate.cc

Issue 2718563008: mash: Use mojo for ShelfItemDelegate and [app] MenuItem. (Closed)
Patch Set: Cleanup; fix ash_shell compile and a couple tests. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "ash/common/shelf/app_list_shelf_item_delegate.h" 5 #include "ash/common/shelf/app_list_shelf_item_delegate.h"
6 6
7 #include "ash/common/shelf/shelf_model.h" 7 #include "ash/common/shelf/shelf_model.h"
8 #include "ash/common/wm_shell.h" 8 #include "ash/common/wm_shell.h"
9 #include "ash/strings/grit/ash_strings.h" 9 #include "ash/strings/grit/ash_strings.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 14 matching lines...) Expand all
25 // Create an AppListShelfItemDelegate for that item. 25 // Create an AppListShelfItemDelegate for that item.
26 ShelfID id = model->items()[index].id; 26 ShelfID id = model->items()[index].id;
27 DCHECK_GE(id, 0); 27 DCHECK_GE(id, 0);
28 model->SetShelfItemDelegate(id, base::MakeUnique<AppListShelfItemDelegate>()); 28 model->SetShelfItemDelegate(id, base::MakeUnique<AppListShelfItemDelegate>());
29 } 29 }
30 30
31 AppListShelfItemDelegate::AppListShelfItemDelegate() {} 31 AppListShelfItemDelegate::AppListShelfItemDelegate() {}
32 32
33 AppListShelfItemDelegate::~AppListShelfItemDelegate() {} 33 AppListShelfItemDelegate::~AppListShelfItemDelegate() {}
34 34
35 ShelfAction AppListShelfItemDelegate::ItemSelected(ui::EventType event_type, 35 void AppListShelfItemDelegate::ItemSelected(
36 int event_flags, 36 std::unique_ptr<ui::Event> event,
37 int64_t display_id, 37 int64_t display_id,
38 ShelfLaunchSource source) { 38 ShelfLaunchSource source,
39 const ItemSelectedCallback& callback) {
39 WmShell::Get()->ToggleAppList(); 40 WmShell::Get()->ToggleAppList();
40 return SHELF_ACTION_APP_LIST_SHOWN; 41 callback.Run(SHELF_ACTION_APP_LIST_SHOWN, MenuItemList());
41 }
42
43 ShelfAppMenuItemList AppListShelfItemDelegate::GetAppMenuItems(
44 int event_flags) {
45 // Return an empty item list to avoid showing an application menu.
46 return ShelfAppMenuItemList();
47 } 42 }
48 43
49 void AppListShelfItemDelegate::ExecuteCommand(uint32_t command_id, 44 void AppListShelfItemDelegate::ExecuteCommand(uint32_t command_id,
50 int event_flags) { 45 int32_t event_flags) {
51 // This delegate does not support showing an application menu. 46 // This delegate does not support showing an application menu.
52 NOTIMPLEMENTED(); 47 NOTIMPLEMENTED();
53 } 48 }
54 49
55 void AppListShelfItemDelegate::Close() {} 50 void AppListShelfItemDelegate::Close() {}
56 51
57 } // namespace ash 52 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698