OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_VIEWS_CONTROLS_BUTTON_MENU_BUTTON_H_ | 5 #ifndef CHROME_VIEWS_CONTROLS_BUTTON_MENU_BUTTON_H_ |
6 #define CHROME_VIEWS_CONTROLS_BUTTON_MENU_BUTTON_H_ | 6 #define CHROME_VIEWS_CONTROLS_BUTTON_MENU_BUTTON_H_ |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
9 | 9 |
10 #include "chrome/common/gfx/chrome_font.h" | 10 #include "chrome/common/gfx/chrome_font.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 class MenuButton : public TextButton { | 28 class MenuButton : public TextButton { |
29 public: | 29 public: |
30 // | 30 // |
31 // Create a Button | 31 // Create a Button |
32 MenuButton(ButtonListener* listener, | 32 MenuButton(ButtonListener* listener, |
33 const std::wstring& text, | 33 const std::wstring& text, |
34 ViewMenuDelegate* menu_delegate, | 34 ViewMenuDelegate* menu_delegate, |
35 bool show_menu_marker); | 35 bool show_menu_marker); |
36 virtual ~MenuButton(); | 36 virtual ~MenuButton(); |
37 | 37 |
| 38 void set_menu_delegate(ViewMenuDelegate* delegate) { |
| 39 menu_delegate_ = delegate; |
| 40 } |
| 41 |
38 // Activate the button (called when the button is pressed). | 42 // Activate the button (called when the button is pressed). |
39 virtual bool Activate(); | 43 virtual bool Activate(); |
40 | 44 |
41 // Overridden to take into account the potential use of a drop marker. | 45 // Overridden to take into account the potential use of a drop marker. |
42 virtual gfx::Size GetPreferredSize(); | 46 virtual gfx::Size GetPreferredSize(); |
43 virtual void Paint(ChromeCanvas* canvas, bool for_drag); | 47 virtual void Paint(ChromeCanvas* canvas, bool for_drag); |
44 | 48 |
45 // These methods are overriden to implement a simple push button | 49 // These methods are overriden to implement a simple push button |
46 // behavior | 50 // behavior |
47 virtual bool OnMousePressed(const MouseEvent& e); | 51 virtual bool OnMousePressed(const MouseEvent& e); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 | 93 |
90 // Whether or not we're showing a drop marker. | 94 // Whether or not we're showing a drop marker. |
91 bool show_menu_marker_; | 95 bool show_menu_marker_; |
92 | 96 |
93 friend class TextButtonBackground; | 97 friend class TextButtonBackground; |
94 }; | 98 }; |
95 | 99 |
96 } // namespace views | 100 } // namespace views |
97 | 101 |
98 #endif // CHROME_VIEWS_CONTROLS_BUTTON_MENU_BUTTON_H_ | 102 #endif // CHROME_VIEWS_CONTROLS_BUTTON_MENU_BUTTON_H_ |
OLD | NEW |