1 // Copyright (c) 2014 GitHub, Inc. All rights reserved.
2 // Use of this source code is governed by the MIT license that can be
3 // found in the LICENSE file.
5 #ifndef ATOM_BROWSER_UI_VIEWS_SUBMENU_BUTTON_H_
6 #define ATOM_BROWSER_UI_VIEWS_SUBMENU_BUTTON_H_
8 #include "ui/views/controls/button/menu_button.h"
12 // Special button that used by menu bar to show submenus.
13 class SubmenuButton : public views::MenuButton {
15 SubmenuButton(views::ButtonListener* listener,
16 const base::string16& title,
17 views::MenuButtonListener* menu_button_listener);
18 virtual ~SubmenuButton();
20 void SetAcceleratorVisibility(bool visible);
21 void SetUnderlineColor(SkColor color);
23 base::char16 accelerator() const { return accelerator_; }
26 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
29 bool GetUnderlinePosition(
30 const base::string16& text, int* start, int* end);
31 void GetCharacterPosition(
32 const base::string16& text, int index, int* pos);
34 base::char16 accelerator_;
42 SkColor underline_color_;
44 DISALLOW_COPY_AND_ASSIGN(SubmenuButton);
49 #endif // ATOM_BROWSER_UI_VIEWS_SUBMENU_BUTTON_H_