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 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 "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
11 #include "ui/gfx/font.h" | 11 #include "ui/gfx/font.h" |
12 #include "ui/views/controls/button/menu_button.h" | 12 #include "ui/views/controls/button/menu_button.h" |
13 #include "ui/views/controls/button/menu_button_delegate.h" | 13 #include "ui/views/controls/button/menu_button_listener.h" |
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 // Different text styles for different types of backgrounds. | 19 // Different text styles for different types of backgrounds. |
20 enum TextStyle { | 20 enum TextStyle { |
21 WHITE_PLAIN_BOLD, | 21 WHITE_PLAIN_BOLD, |
22 GRAY_PLAIN_LIGHT, | 22 GRAY_PLAIN_LIGHT, |
23 WHITE_HALOED_BOLD, | 23 WHITE_HALOED_BOLD, |
(...skipping 21 matching lines...) Expand all Loading... |
45 virtual TextStyle GetStatusAreaTextStyle() const = 0; | 45 virtual TextStyle GetStatusAreaTextStyle() const = 0; |
46 | 46 |
47 // Handle visibility changes (e.g. resize the status area). | 47 // Handle visibility changes (e.g. resize the status area). |
48 virtual void ButtonVisibilityChanged(views::View* button_view) = 0; | 48 virtual void ButtonVisibilityChanged(views::View* button_view) = 0; |
49 | 49 |
50 protected: | 50 protected: |
51 virtual ~Delegate() {} | 51 virtual ~Delegate() {} |
52 }; | 52 }; |
53 | 53 |
54 StatusAreaButton(Delegate* button_delegate, | 54 StatusAreaButton(Delegate* button_delegate, |
55 views::MenuButtonDelegate* menu_delegate); | 55 views::MenuButtonListener* menu_button_listener); |
56 virtual ~StatusAreaButton() {} | 56 virtual ~StatusAreaButton() {} |
57 virtual void PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) OVERRIDE; | 57 virtual void PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) OVERRIDE; |
58 | 58 |
59 // Overrides TextButton's SetText to clear max text size before seting new | 59 // Overrides TextButton's SetText to clear max text size before seting new |
60 // text content so that the button size would fit the new text size. | 60 // text content so that the button size would fit the new text size. |
61 virtual void SetText(const string16& text) OVERRIDE; | 61 virtual void SetText(const string16& text) OVERRIDE; |
62 | 62 |
63 // views::MenuButton overrides. | 63 // views::MenuButton overrides. |
64 virtual bool Activate() OVERRIDE; | 64 virtual bool Activate() OVERRIDE; |
65 | 65 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 Delegate* delegate_; | 103 Delegate* delegate_; |
104 | 104 |
105 // Fonts used to render the button's text. | 105 // Fonts used to render the button's text. |
106 gfx::Font light_font_; | 106 gfx::Font light_font_; |
107 gfx::Font bold_font_; | 107 gfx::Font bold_font_; |
108 | 108 |
109 DISALLOW_COPY_AND_ASSIGN(StatusAreaButton); | 109 DISALLOW_COPY_AND_ASSIGN(StatusAreaButton); |
110 }; | 110 }; |
111 | 111 |
112 #endif // CHROME_BROWSER_CHROMEOS_STATUS_STATUS_AREA_BUTTON_H_ | 112 #endif // CHROME_BROWSER_CHROMEOS_STATUS_STATUS_AREA_BUTTON_H_ |
OLD | NEW |