| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_CHROMEOS_VIEWS_DROPDOWN_BUTTON_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_VIEWS_DROPDOWN_BUTTON_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_VIEWS_DROPDOWN_BUTTON_H_ | 6 #define CHROME_BROWSER_CHROMEOS_VIEWS_DROPDOWN_BUTTON_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" |
| 11 #include "views/controls/button/menu_button.h" | 12 #include "views/controls/button/menu_button.h" |
| 12 | 13 |
| 13 namespace chromeos { | 14 namespace chromeos { |
| 14 | 15 |
| 15 // MenuButton specification that uses different icons to draw the button and | 16 // MenuButton specification that uses different icons to draw the button and |
| 16 // adjust focus frame accordingly to the icons particularities. | 17 // adjust focus frame accordingly to the icons particularities. |
| 17 class DropDownButton : public views::MenuButton { | 18 class DropDownButton : public views::MenuButton { |
| 18 public: | 19 public: |
| 19 DropDownButton(views::ButtonListener* listener, | 20 DropDownButton(views::ButtonListener* listener, |
| 20 const string16& text, | 21 const string16& text, |
| 21 views::ViewMenuDelegate* menu_delegate, | 22 views::ViewMenuDelegate* menu_delegate, |
| 22 bool show_menu_marker); | 23 bool show_menu_marker); |
| 23 virtual ~DropDownButton(); | 24 virtual ~DropDownButton(); |
| 24 | 25 |
| 25 virtual void OnPaintFocusBorder(gfx::Canvas* canvas); | 26 virtual void OnPaintFocusBorder(gfx::Canvas* canvas) OVERRIDE; |
| 26 | 27 |
| 27 // Override SetText to set the accessible value, rather than the | 28 // Override SetText to set the accessible value, rather than the |
| 28 // accessible name, since this acts more like a combo box than a | 29 // accessible name, since this acts more like a combo box than a |
| 29 // menu. | 30 // menu. |
| 30 virtual void SetText(const string16& text); | 31 virtual void SetText(const string16& text) OVERRIDE; |
| 31 | 32 |
| 32 virtual string16 GetAccessibleValue(); | 33 virtual string16 GetAccessibleValue(); |
| 33 | 34 |
| 34 private: | 35 private: |
| 35 DISALLOW_COPY_AND_ASSIGN(DropDownButton); | 36 DISALLOW_COPY_AND_ASSIGN(DropDownButton); |
| 36 }; | 37 }; |
| 37 | 38 |
| 38 } // namespace chromeos | 39 } // namespace chromeos |
| 39 | 40 |
| 40 #endif // CHROME_BROWSER_CHROMEOS_VIEWS_DROPDOWN_BUTTON_H_ | 41 #endif // CHROME_BROWSER_CHROMEOS_VIEWS_DROPDOWN_BUTTON_H_ |
| OLD | NEW |