OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef UI_APP_LIST_VIEWS_APP_LIST_MENU_VIEWS_H_ | |
6 #define UI_APP_LIST_VIEWS_APP_LIST_MENU_VIEWS_H_ | |
7 | |
8 #include <memory> | |
9 | |
10 #include "base/macros.h" | |
11 #include "ui/app_list/app_list_menu.h" | |
12 #include "ui/views/controls/menu/menu_model_adapter.h" | |
13 #include "ui/views/controls/menu/menu_runner.h" | |
14 | |
15 namespace gfx { | |
16 class Point; | |
17 } | |
18 | |
19 namespace views { | |
20 class MenuButton; | |
21 } | |
22 | |
23 namespace app_list { | |
24 | |
25 // Views implementation of the app list menu. | |
26 // TODO(benwells): We should consider moving this into Chrome. | |
27 class AppListMenuViews : public AppListMenu { | |
28 public: | |
29 explicit AppListMenuViews(AppListViewDelegate* delegate); | |
30 ~AppListMenuViews() override; | |
31 | |
32 void RunMenuAt(views::MenuButton* button, const gfx::Point& point); | |
33 void Cancel(); | |
34 | |
35 private: | |
36 // The context menu itself and its contents. | |
37 std::unique_ptr<views::MenuModelAdapter> menu_delegate_; | |
38 views::MenuItemView* menu_; // Owned by menu_runner_. | |
39 std::unique_ptr<views::MenuRunner> menu_runner_; | |
40 | |
41 DISALLOW_COPY_AND_ASSIGN(AppListMenuViews); | |
42 }; | |
43 | |
44 } // namespace app_list | |
45 | |
46 #endif // UI_APP_LIST_VIEWS_APP_LIST_MENU_VIEWS_H_ | |
OLD | NEW |