[email protected] | f0a95b44 | 2013-09-10 17:40:15 | [diff] [blame] | 1 | // Copyright 2013 The Chromium Authors. All rights reserved. |
[email protected] | 5544450 | 2012-05-10 15:43:53 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
James Cook | 643b718 | 2017-03-05 22:02:58 | [diff] [blame^] | 5 | #ifndef ASH_COMMON_SHELF_SHELF_ALIGNMENT_MENU_H_ |
6 | #define ASH_COMMON_SHELF_SHELF_ALIGNMENT_MENU_H_ | ||||
[email protected] | 5544450 | 2012-05-10 15:43:53 | [diff] [blame] | 7 | |
8 | #include "ash/ash_export.h" | ||||
avi | db567a8a | 2015-12-20 17:07:24 | [diff] [blame] | 9 | #include "base/macros.h" |
[email protected] | 5544450 | 2012-05-10 15:43:53 | [diff] [blame] | 10 | #include "ui/base/models/simple_menu_model.h" |
11 | |||||
12 | namespace ash { | ||||
13 | |||||
jamescook | da53c14 | 2016-06-08 23:38:56 | [diff] [blame] | 14 | class WmShelf; |
msw | 953caf1f | 2016-03-18 00:33:29 | [diff] [blame] | 15 | |
jamescook | da53c14 | 2016-06-08 23:38:56 | [diff] [blame] | 16 | // Submenu for choosing the alignment of the shelf. |
[email protected] | f0a95b44 | 2013-09-10 17:40:15 | [diff] [blame] | 17 | class ASH_EXPORT ShelfAlignmentMenu : public ui::SimpleMenuModel, |
18 | public ui::SimpleMenuModel::Delegate { | ||||
[email protected] | 5544450 | 2012-05-10 15:43:53 | [diff] [blame] | 19 | public: |
jamescook | da53c14 | 2016-06-08 23:38:56 | [diff] [blame] | 20 | explicit ShelfAlignmentMenu(WmShelf* wm_shelf); |
dcheng | 419957cf | 2014-10-30 22:51:40 | [diff] [blame] | 21 | ~ShelfAlignmentMenu() override; |
[email protected] | 5544450 | 2012-05-10 15:43:53 | [diff] [blame] | 22 | |
23 | // ui::SimpleMenuModel::Delegate overrides: | ||||
dcheng | 419957cf | 2014-10-30 22:51:40 | [diff] [blame] | 24 | bool IsCommandIdChecked(int command_id) const override; |
25 | bool IsCommandIdEnabled(int command_id) const override; | ||||
dcheng | 419957cf | 2014-10-30 22:51:40 | [diff] [blame] | 26 | void ExecuteCommand(int command_id, int event_flags) override; |
[email protected] | 5544450 | 2012-05-10 15:43:53 | [diff] [blame] | 27 | |
28 | private: | ||||
29 | enum MenuItem { | ||||
30 | // Offset so as not to interfere with other menus. | ||||
31 | MENU_ALIGN_LEFT = 500, | ||||
32 | MENU_ALIGN_RIGHT, | ||||
33 | MENU_ALIGN_BOTTOM, | ||||
34 | }; | ||||
35 | |||||
jamescook | da53c14 | 2016-06-08 23:38:56 | [diff] [blame] | 36 | WmShelf* wm_shelf_; |
[email protected] | 431552c | 2012-10-23 00:38:33 | [diff] [blame] | 37 | |
[email protected] | f0a95b44 | 2013-09-10 17:40:15 | [diff] [blame] | 38 | DISALLOW_COPY_AND_ASSIGN(ShelfAlignmentMenu); |
[email protected] | 5544450 | 2012-05-10 15:43:53 | [diff] [blame] | 39 | }; |
40 | |||||
41 | } // namespace ash | ||||
42 | |||||
James Cook | 643b718 | 2017-03-05 22:02:58 | [diff] [blame^] | 43 | #endif // ASH_COMMON_SHELF_SHELF_ALIGNMENT_MENU_H_ |