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/text_button.h" |
10 | 10 |
11 class BrowserView; | 11 class BrowserView; |
12 | 12 |
13 namespace ui { | 13 namespace ui { |
14 class MouseEvent; | 14 class MouseEvent; |
15 class ThemeProvider; | 15 class ThemeProvider; |
16 } | 16 } |
17 | 17 |
18 // AvatarLabel | 18 // AvatarLabel |
19 // | 19 // |
20 // A label used to display a string indicating that the current profile belongs | 20 // A label used to display a string indicating that the current profile belongs |
21 // to a managed user. | 21 // to a managed user. |
22 class AvatarLabel : public views::TextButton { | 22 class AvatarLabel : public views::TextButton { |
23 public: | 23 public: |
24 explicit AvatarLabel(BrowserView* browser_view); | 24 explicit AvatarLabel(BrowserView* browser_view); |
25 virtual ~AvatarLabel(); | 25 virtual ~AvatarLabel(); |
26 | 26 |
27 // views::TextButton: | |
Peter Kasting
2014/01/16 21:46:17
Nit: Don't remove this.
Adrian Kuegel
2014/01/17 09:42:17
Thanks for catching this. I removed this accidenta
| |
28 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; | 27 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; |
29 | 28 |
30 // Update the style of the label according to the provided theme. | 29 // Update the style of the label according to the provided theme. |
31 void UpdateLabelStyle(); | 30 void UpdateLabelStyle(); |
32 | 31 |
32 // Sets whether the label should be displayed on the right or on the left. A | |
33 // new button border is created which has the right insets for the positioning | |
34 // of the button. | |
35 void SetLabelOnRight(bool label_on_right); | |
36 | |
33 private: | 37 private: |
34 BrowserView* browser_view_; | 38 BrowserView* browser_view_; |
35 | 39 |
36 DISALLOW_COPY_AND_ASSIGN(AvatarLabel); | 40 DISALLOW_COPY_AND_ASSIGN(AvatarLabel); |
37 }; | 41 }; |
38 | 42 |
39 #endif // CHROME_BROWSER_UI_VIEWS_AVATAR_LABEL_H_ | 43 #endif // CHROME_BROWSER_UI_VIEWS_AVATAR_LABEL_H_ |
OLD | NEW |