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_STATUS_STATUS_AREA_BUTTON_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_STATUS_STATUS_AREA_BUTTON_H_ |
6 #define CHROME_BROWSER_CHROMEOS_STATUS_STATUS_AREA_BUTTON_H_ | 6 #define CHROME_BROWSER_CHROMEOS_STATUS_STATUS_AREA_BUTTON_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "chrome/browser/chromeos/status/status_area_host.h" | 9 #include "chrome/browser/chromeos/status/status_area_host.h" |
10 #include "views/controls/button/menu_button.h" | 10 #include "views/controls/button/menu_button.h" |
11 #include "views/controls/menu/view_menu_delegate.h" | 11 #include "views/controls/menu/view_menu_delegate.h" |
12 | 12 |
13 namespace chromeos { | 13 namespace chromeos { |
14 | 14 |
15 // Button to be used to represent status and allow menus to be popped up. | 15 // Button to be used to represent status and allow menus to be popped up. |
16 // Shows current button state by drawing a border around the current icon. | 16 // Shows current button state by drawing a border around the current icon. |
17 class StatusAreaButton : public views::MenuButton { | 17 class StatusAreaButton : public views::MenuButton { |
18 public: | 18 public: |
19 explicit StatusAreaButton(StatusAreaHost* host, | 19 StatusAreaButton(StatusAreaHost* host, |
20 views::ViewMenuDelegate* menu_delegate); | 20 views::ViewMenuDelegate* menu_delegate); |
21 virtual ~StatusAreaButton() {} | 21 virtual ~StatusAreaButton() {} |
22 virtual void PaintButton(gfx::Canvas* canvas, PaintButtonMode mode); | 22 virtual void PaintButton(gfx::Canvas* canvas, PaintButtonMode mode); |
23 | 23 |
24 // Overrides TextButton's SetText to clear max text size before seting new | 24 // Overrides TextButton's SetText to clear max text size before seting new |
25 // text content so that the button size would fit the new text size. | 25 // text content so that the button size would fit the new text size. |
26 virtual void SetText(const std::wstring& text); | 26 virtual void SetText(const std::wstring& text); |
27 | 27 |
28 void set_use_menu_button_paint(bool use_menu_button_paint) { | 28 void set_use_menu_button_paint(bool use_menu_button_paint) { |
29 use_menu_button_paint_ = use_menu_button_paint; | 29 use_menu_button_paint_ = use_menu_button_paint; |
30 } | 30 } |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
69 private: | 69 private: |
70 void UpdateTextStyle(); | 70 void UpdateTextStyle(); |
71 | 71 |
72 DISALLOW_COPY_AND_ASSIGN(StatusAreaButton); | 72 DISALLOW_COPY_AND_ASSIGN(StatusAreaButton); |
73 }; | 73 }; |
74 | 74 |
75 } // namespace chromeos | 75 } // namespace chromeos |
76 | 76 |
77 #endif // CHROME_BROWSER_CHROMEOS_STATUS_STATUS_AREA_BUTTON_H_ | 77 #endif // CHROME_BROWSER_CHROMEOS_STATUS_STATUS_AREA_BUTTON_H_ |
OLD | NEW |