OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_UI_VIEWS_AVATAR_LABEL_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_AVATAR_LABEL_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_AVATAR_LABEL_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_AVATAR_LABEL_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "ui/views/controls/button/text_button.h" | 9 #include "ui/views/controls/button/label_button.h" |
10 | 10 |
11 class BrowserView; | 11 class BrowserView; |
12 | 12 |
13 namespace ui { | |
14 class MouseEvent; | |
15 class ThemeProvider; | |
16 } | |
17 | |
18 // AvatarLabel | 13 // AvatarLabel |
19 // | 14 // |
20 // A label used to display a string indicating that the current profile belongs | 15 // A label used to display a string indicating that the current profile belongs |
21 // to a managed user. | 16 // to a managed user. |
22 class AvatarLabel : public views::TextButton { | 17 class AvatarLabel : public views::LabelButton { |
23 public: | 18 public: |
24 explicit AvatarLabel(BrowserView* browser_view); | 19 explicit AvatarLabel(BrowserView* browser_view); |
25 virtual ~AvatarLabel(); | 20 virtual ~AvatarLabel(); |
26 | 21 |
27 // views::TextButton: | 22 // views::LabelButton: |
28 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; | 23 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; |
29 | 24 |
30 // Update the style of the label according to the provided theme. | 25 // Update the style of the label according to the provided theme. |
31 void UpdateLabelStyle(); | 26 void UpdateLabelStyle(); |
32 | 27 |
33 // Sets whether the label should be displayed on the right or on the left. A | 28 // Sets whether the label should be displayed on the right or on the left. A |
34 // new button border is created which has the right insets for the positioning | 29 // new button border is created which has the right insets for the positioning |
35 // of the button. | 30 // of the button. |
36 void SetLabelOnRight(bool label_on_right); | 31 void SetLabelOnRight(bool label_on_right); |
37 | 32 |
38 private: | 33 private: |
39 BrowserView* browser_view_; | 34 BrowserView* browser_view_; |
40 | 35 |
41 DISALLOW_COPY_AND_ASSIGN(AvatarLabel); | 36 DISALLOW_COPY_AND_ASSIGN(AvatarLabel); |
42 }; | 37 }; |
43 | 38 |
44 #endif // CHROME_BROWSER_UI_VIEWS_AVATAR_LABEL_H_ | 39 #endif // CHROME_BROWSER_UI_VIEWS_AVATAR_LABEL_H_ |
OLD | NEW |