| 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_BROWSER_CHROMEOS_STATUS_AREA_BUTTON_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_STATUS_AREA_BUTTON_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_STATUS_AREA_BUTTON_H_ | 6 #define CHROME_BROWSER_CHROMEOS_STATUS_AREA_BUTTON_H_ |
| 7 | 7 |
| 8 #include "views/controls/button/menu_button.h" | 8 #include "views/controls/button/menu_button.h" |
| 9 #include "views/controls/menu/view_menu_delegate.h" | 9 #include "views/controls/menu/view_menu_delegate.h" |
| 10 | 10 |
| 11 // Button to be used to represent status and allow menus to be popped up. | 11 // Button to be used to represent status and allow menus to be popped up. |
| 12 // Shows current button state by drawing a border around the current icon. | 12 // Shows current button state by drawing a border around the current icon. |
| 13 class StatusAreaButton : public views::MenuButton { | 13 class StatusAreaButton : public views::MenuButton { |
| 14 public: | 14 public: |
| 15 StatusAreaButton(views::ViewMenuDelegate* menu_delegate); | 15 explicit StatusAreaButton(views::ViewMenuDelegate* menu_delegate); |
| 16 virtual ~StatusAreaButton() {} | 16 virtual ~StatusAreaButton() {} |
| 17 virtual void Paint(gfx::Canvas* canvas, bool for_drag); | 17 virtual void Paint(gfx::Canvas* canvas, bool for_drag); |
| 18 |
| 19 protected: |
| 20 // Draws the icon for this status area button on the canvas. |
| 21 // Subclasses should override this method if they need to draw their own icon. |
| 22 // Otherwise, just call SetIcon() and the it will be handled for you. |
| 23 virtual void DrawIcon(gfx::Canvas* canvas); |
| 24 |
| 25 DISALLOW_COPY_AND_ASSIGN(StatusAreaButton); |
| 18 }; | 26 }; |
| 19 | 27 |
| 20 #endif // CHROME_BROWSER_CHROMEOS_STATUS_AREA_BUTTON_H_ | 28 #endif // CHROME_BROWSER_CHROMEOS_STATUS_AREA_BUTTON_H_ |
| OLD | NEW |