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