| 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 UI_VIEWS_CONTROLS_BUTTON_MENU_BUTTON_H_ | 5 #ifndef UI_VIEWS_CONTROLS_BUTTON_MENU_BUTTON_H_ |
| 6 #define UI_VIEWS_CONTROLS_BUTTON_MENU_BUTTON_H_ | 6 #define UI_VIEWS_CONTROLS_BUTTON_MENU_BUTTON_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/string16.h" | 10 #include "base/string16.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 public: | 30 public: |
| 31 static const char kViewClassName[]; | 31 static const char kViewClassName[]; |
| 32 | 32 |
| 33 // Create a Button. | 33 // Create a Button. |
| 34 MenuButton(ButtonListener* listener, | 34 MenuButton(ButtonListener* listener, |
| 35 const string16& text, | 35 const string16& text, |
| 36 MenuButtonListener* menu_button_listener, | 36 MenuButtonListener* menu_button_listener, |
| 37 bool show_menu_marker); | 37 bool show_menu_marker); |
| 38 virtual ~MenuButton(); | 38 virtual ~MenuButton(); |
| 39 | 39 |
| 40 bool show_menu_marker() const { return show_menu_marker_; } |
| 40 void set_menu_marker(const gfx::ImageSkia* menu_marker) { | 41 void set_menu_marker(const gfx::ImageSkia* menu_marker) { |
| 41 menu_marker_ = menu_marker; | 42 menu_marker_ = menu_marker; |
| 42 } | 43 } |
| 44 const gfx::ImageSkia* menu_marker() const { return menu_marker_; } |
| 43 | 45 |
| 44 const gfx::Point& menu_offset() const { return menu_offset_; } | 46 const gfx::Point& menu_offset() const { return menu_offset_; } |
| 45 void set_menu_offset(int x, int y) { menu_offset_.SetPoint(x, y); } | 47 void set_menu_offset(int x, int y) { menu_offset_.SetPoint(x, y); } |
| 46 | 48 |
| 47 // Activate the button (called when the button is pressed). | 49 // Activate the button (called when the button is pressed). |
| 48 virtual bool Activate(); | 50 virtual bool Activate(); |
| 49 | 51 |
| 50 // Overridden from TextButton for the potential use of a drop marker. | 52 // Overridden from TextButton for the potential use of a drop marker. |
| 51 virtual void PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) OVERRIDE; | 53 virtual void PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) OVERRIDE; |
| 52 | 54 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 // If non-null the destuctor sets this to true. This is set while the menu is | 98 // If non-null the destuctor sets this to true. This is set while the menu is |
| 97 // showing and used to detect if the menu was deleted while running. | 99 // showing and used to detect if the menu was deleted while running. |
| 98 bool* destroyed_flag_; | 100 bool* destroyed_flag_; |
| 99 | 101 |
| 100 DISALLOW_COPY_AND_ASSIGN(MenuButton); | 102 DISALLOW_COPY_AND_ASSIGN(MenuButton); |
| 101 }; | 103 }; |
| 102 | 104 |
| 103 } // namespace views | 105 } // namespace views |
| 104 | 106 |
| 105 #endif // UI_VIEWS_CONTROLS_BUTTON_MENU_BUTTON_H_ | 107 #endif // UI_VIEWS_CONTROLS_BUTTON_MENU_BUTTON_H_ |
| OLD | NEW |