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/shelf/shelf_alignment_menu.h" | 8 #include "ash/shelf/shelf_alignment_menu.h" |
9 #include "ash/shelf/shelf_item_types.h" | 9 #include "ash/shelf/shelf_item_types.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 // Creates a menu used by item created by ShelfWindowWatcher. | 39 // Creates a menu used by item created by ShelfWindowWatcher. |
40 LauncherContextMenu(ChromeLauncherController* controller, | 40 LauncherContextMenu(ChromeLauncherController* controller, |
41 ash::ShelfItemDelegate* item_delegate, | 41 ash::ShelfItemDelegate* item_delegate, |
42 ash::ShelfItem* item, | 42 ash::ShelfItem* item, |
43 aura::Window* root_window); | 43 aura::Window* root_window); |
44 | 44 |
45 // 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|. |
46 LauncherContextMenu(ChromeLauncherController* controller, | 46 LauncherContextMenu(ChromeLauncherController* controller, |
47 aura::Window* root_window); | 47 aura::Window* root_window); |
48 virtual ~LauncherContextMenu(); | 48 ~LauncherContextMenu() override; |
49 | 49 |
50 void Init(); | 50 void Init(); |
51 | 51 |
52 // ID of the item we're showing the context menu for. | 52 // ID of the item we're showing the context menu for. |
53 ash::ShelfID id() const { return item_.id; } | 53 ash::ShelfID id() const { return item_.id; } |
54 | 54 |
55 // ui::SimpleMenuModel::Delegate overrides: | 55 // ui::SimpleMenuModel::Delegate overrides: |
56 virtual bool IsItemForCommandIdDynamic(int command_id) const override; | 56 bool IsItemForCommandIdDynamic(int command_id) const override; |
57 virtual base::string16 GetLabelForCommandId(int command_id) const override; | 57 base::string16 GetLabelForCommandId(int command_id) const override; |
58 virtual bool IsCommandIdChecked(int command_id) const override; | 58 bool IsCommandIdChecked(int command_id) const override; |
59 virtual bool IsCommandIdEnabled(int command_id) const override; | 59 bool IsCommandIdEnabled(int command_id) const override; |
60 virtual bool IsCommandIdVisible(int command_id) const override; | 60 bool IsCommandIdVisible(int command_id) const override; |
61 virtual bool GetAcceleratorForCommandId( | 61 bool GetAcceleratorForCommandId(int command_id, |
62 int command_id, | 62 ui::Accelerator* accelerator) override; |
63 ui::Accelerator* accelerator) override; | 63 void ExecuteCommand(int command_id, int event_flags) override; |
64 virtual void ExecuteCommand(int command_id, int event_flags) override; | |
65 | 64 |
66 private: | 65 private: |
67 FRIEND_TEST_ALL_PREFIXES( | 66 FRIEND_TEST_ALL_PREFIXES( |
68 LauncherContextMenuTest, | 67 LauncherContextMenuTest, |
69 NewIncognitoWindowMenuIsDisabledWhenIncognitoModeOff); | 68 NewIncognitoWindowMenuIsDisabledWhenIncognitoModeOff); |
70 FRIEND_TEST_ALL_PREFIXES( | 69 FRIEND_TEST_ALL_PREFIXES( |
71 LauncherContextMenuTest, | 70 LauncherContextMenuTest, |
72 NewWindowMenuIsDisabledWhenIncognitoModeForced); | 71 NewWindowMenuIsDisabledWhenIncognitoModeForced); |
73 FRIEND_TEST_ALL_PREFIXES( | 72 FRIEND_TEST_ALL_PREFIXES( |
74 LauncherContextMenuTest, | 73 LauncherContextMenuTest, |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 | 105 |
107 aura::Window* root_window_; | 106 aura::Window* root_window_; |
108 | 107 |
109 // Not owned. | 108 // Not owned. |
110 ash::ShelfItemDelegate* item_delegate_; | 109 ash::ShelfItemDelegate* item_delegate_; |
111 | 110 |
112 DISALLOW_COPY_AND_ASSIGN(LauncherContextMenu); | 111 DISALLOW_COPY_AND_ASSIGN(LauncherContextMenu); |
113 }; | 112 }; |
114 | 113 |
115 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_CONTEXT_MENU_H_ | 114 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_LAUNCHER_CONTEXT_MENU_H_ |
OLD | NEW |