OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 VIEWS_CONTROLS_BUTTON_MENU_BUTTON_H_ | 5 #ifndef VIEWS_CONTROLS_BUTTON_MENU_BUTTON_H_ |
6 #define VIEWS_CONTROLS_BUTTON_MENU_BUTTON_H_ | 6 #define VIEWS_CONTROLS_BUTTON_MENU_BUTTON_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 static const char kViewClassName[]; | 31 static const char kViewClassName[]; |
32 | 32 |
33 // | 33 // |
34 // Create a Button | 34 // Create a Button |
35 MenuButton(ButtonListener* listener, | 35 MenuButton(ButtonListener* listener, |
36 const std::wstring& text, | 36 const std::wstring& text, |
37 ViewMenuDelegate* menu_delegate, | 37 ViewMenuDelegate* menu_delegate, |
38 bool show_menu_marker); | 38 bool show_menu_marker); |
39 virtual ~MenuButton(); | 39 virtual ~MenuButton(); |
40 | 40 |
41 void set_menu_delegate(ViewMenuDelegate* delegate) { | |
42 menu_delegate_ = delegate; | |
43 } | |
44 | |
45 void set_menu_marker(const SkBitmap* menu_marker) { | 41 void set_menu_marker(const SkBitmap* menu_marker) { |
46 menu_marker_ = menu_marker; | 42 menu_marker_ = menu_marker; |
47 } | 43 } |
48 | 44 |
49 // Activate the button (called when the button is pressed). | 45 // Activate the button (called when the button is pressed). |
50 virtual bool Activate(); | 46 virtual bool Activate(); |
51 | 47 |
52 // Overridden to take into account the potential use of a drop marker. | 48 // Overridden to take into account the potential use of a drop marker. |
53 virtual gfx::Size GetPreferredSize(); | 49 virtual gfx::Size GetPreferredSize(); |
54 virtual void Paint(gfx::Canvas* canvas, bool for_drag); | 50 virtual void Paint(gfx::Canvas* canvas, bool for_drag); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 // If non-null the destuctor sets this to true. This is set while the menu is | 97 // If non-null the destuctor sets this to true. This is set while the menu is |
102 // showing and used to detect if the menu was deleted while running. | 98 // showing and used to detect if the menu was deleted while running. |
103 bool* destroyed_flag_; | 99 bool* destroyed_flag_; |
104 | 100 |
105 DISALLOW_COPY_AND_ASSIGN(MenuButton); | 101 DISALLOW_COPY_AND_ASSIGN(MenuButton); |
106 }; | 102 }; |
107 | 103 |
108 } // namespace views | 104 } // namespace views |
109 | 105 |
110 #endif // VIEWS_CONTROLS_BUTTON_MENU_BUTTON_H_ | 106 #endif // VIEWS_CONTROLS_BUTTON_MENU_BUTTON_H_ |
OLD | NEW |