Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(423)

Side by Side Diff: chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.h

Issue 2671923002: mash: Cleanup ash shelf application menu code. (Closed)
Patch Set: Fix tests; cleanup. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_APP_MENU_ITEM_H_
6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_APP_MENU_ITEM_H_
7
8 #include "base/macros.h"
9 #include "base/strings/string16.h"
10 #include "ui/gfx/image/image.h"
11
12 // A description for a menu item. It contains the menu item description as well
13 // as the function which gets executed upon menu item click.
14 class ChromeLauncherAppMenuItem {
15 public:
16 // To insert a separator before this item set |has_leading_separator|.
17 ChromeLauncherAppMenuItem(const base::string16 title,
18 const gfx::Image* icon,
19 bool has_leading_separator);
20
21 virtual ~ChromeLauncherAppMenuItem();
22
23 // Retrieves the title for this menu option.
24 const base::string16& title() const { return title_; }
25
26 // Retrieves the icon for this menu option.
27 const gfx::Image& icon() const { return icon_; }
28
29 // Returns true if a separator should be inserted before this item.
30 bool HasLeadingSeparator() const { return has_leading_separator_; }
31
32 // Returns true if item is enabled.
33 virtual bool IsEnabled() const;
34
35 // Executes the option.
36 // |event_flags| are the flags from the event which issued this command.
37 // It can be used to check additional keyboard modifiers.
38 virtual void Execute(int event_flags);
39
40 private:
41 const base::string16 title_;
42 const gfx::Image icon_;
43
44 // True if the item has a separator in front of it.
45 const bool has_leading_separator_;
46
47 DISALLOW_COPY_AND_ASSIGN(ChromeLauncherAppMenuItem);
48 };
49 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_CHROME_LAUNCHER_APP_MENU_ITEM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698