OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_CONTEXT_MENU_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_CONTEXT_MENU_H_ |
6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_CONTEXT_MENU_H_ | 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_CONTEXT_MENU_H_ |
7 | 7 |
8 #include "ash/launcher/launcher_types.h" | 8 #include "ash/launcher/launcher_types.h" |
9 #include "ash/shelf/shelf_alignment_menu.h" | 9 #include "ash/shelf/shelf_alignment_menu.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "ui/base/models/simple_menu_model.h" | 13 #include "ui/base/models/simple_menu_model.h" |
14 | 14 |
15 class ChromeLauncherController; | 15 class ChromeLauncherController; |
16 | 16 |
| 17 namespace ash { |
| 18 class ShelfItemDelegate; |
| 19 } |
| 20 |
17 namespace aura { | 21 namespace aura { |
18 class Window; | 22 class Window; |
19 } | 23 } |
20 | 24 |
21 namespace extensions { | 25 namespace extensions { |
22 class ContextMenuMatcher; | 26 class ContextMenuMatcher; |
23 } | 27 } |
24 | 28 |
25 // Context menu shown for a launcher item. | 29 // Context menu shown for a launcher item. |
26 class LauncherContextMenu : public ui::SimpleMenuModel, | 30 class LauncherContextMenu : public ui::SimpleMenuModel, |
27 public ui::SimpleMenuModel::Delegate { | 31 public ui::SimpleMenuModel::Delegate { |
28 public: | 32 public: |
29 // |item| is NULL if the context menu is for the launcher (the user right | 33 // |item| is NULL if the context menu is for the launcher (the user right |
30 // |clicked on an area with no icons). | 34 // |clicked on an area with no icons). |
31 LauncherContextMenu(ChromeLauncherController* controller, | 35 LauncherContextMenu(ChromeLauncherController* controller, |
32 const ash::LauncherItem* item, | 36 const ash::LauncherItem* item, |
33 aura::Window* root_window); | 37 aura::Window* root_window); |
| 38 |
| 39 // Creates a menu used by item created by ShelfWindowWatcher. |
| 40 LauncherContextMenu(ChromeLauncherController* controller, |
| 41 ash::ShelfItemDelegate* item_delegate, |
| 42 ash::LauncherItem* item, |
| 43 aura::Window* root_window); |
| 44 |
34 // Creates a menu used as a desktop context menu on |root_window|. | 45 // Creates a menu used as a desktop context menu on |root_window|. |
35 LauncherContextMenu(ChromeLauncherController* controller, | 46 LauncherContextMenu(ChromeLauncherController* controller, |
36 aura::Window* root_window); | 47 aura::Window* root_window); |
37 virtual ~LauncherContextMenu(); | 48 virtual ~LauncherContextMenu(); |
38 | 49 |
39 void Init(); | 50 void Init(); |
40 | 51 |
41 // ID of the item we're showing the context menu for. | 52 // ID of the item we're showing the context menu for. |
42 ash::LauncherID id() const { return item_.id; } | 53 ash::LauncherID id() const { return item_.id; } |
43 | 54 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 ChromeLauncherController* controller_; | 94 ChromeLauncherController* controller_; |
84 | 95 |
85 ash::LauncherItem item_; | 96 ash::LauncherItem item_; |
86 | 97 |
87 ash::ShelfAlignmentMenu shelf_alignment_menu_; | 98 ash::ShelfAlignmentMenu shelf_alignment_menu_; |
88 | 99 |
89 scoped_ptr<extensions::ContextMenuMatcher> extension_items_; | 100 scoped_ptr<extensions::ContextMenuMatcher> extension_items_; |
90 | 101 |
91 aura::Window* root_window_; | 102 aura::Window* root_window_; |
92 | 103 |
| 104 // Not owned. |
| 105 ash::ShelfItemDelegate* item_delegate_; |
| 106 |
93 DISALLOW_COPY_AND_ASSIGN(LauncherContextMenu); | 107 DISALLOW_COPY_AND_ASSIGN(LauncherContextMenu); |
94 }; | 108 }; |
95 | 109 |
96 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_CONTEXT_MENU_H_ | 110 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_CONTEXT_MENU_H_ |
OLD | NEW |