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 // Internal class name. | |
25 static const char kViewClassName[]; | |
Peter Kasting
2014/01/15 02:06:26
This, and GetClassName(), are only used for a DCHE
Adrian Kuegel
2014/01/15 16:24:51
Done. And filed crbug/334666.
| |
26 | |
24 explicit AvatarLabel(BrowserView* browser_view); | 27 explicit AvatarLabel(BrowserView* browser_view); |
25 virtual ~AvatarLabel(); | 28 virtual ~AvatarLabel(); |
26 | 29 |
27 // views::TextButton: | 30 // views::TextButton: |
31 virtual const char* GetClassName() const OVERRIDE; | |
28 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; | 32 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; |
29 | 33 |
30 // Update the style of the label according to the provided theme. | 34 // Update the style of the label according to the provided theme. |
31 void UpdateLabelStyle(); | 35 void UpdateLabelStyle(); |
32 | 36 |
37 // Sets whether the label should be displayed on the right or on the left. If | |
38 // |label_on_right| differs from the current setting, a new button border is | |
39 // created which has the right insets for the positioning of the button. | |
40 void SetLabelOnRight(bool label_on_right); | |
41 | |
33 private: | 42 private: |
34 BrowserView* browser_view_; | 43 BrowserView* browser_view_; |
44 bool label_on_right_; | |
35 | 45 |
36 DISALLOW_COPY_AND_ASSIGN(AvatarLabel); | 46 DISALLOW_COPY_AND_ASSIGN(AvatarLabel); |
37 }; | 47 }; |
38 | 48 |
39 #endif // CHROME_BROWSER_UI_VIEWS_AVATAR_LABEL_H_ | 49 #endif // CHROME_BROWSER_UI_VIEWS_AVATAR_LABEL_H_ |
OLD | NEW |