OLD | NEW |
1 // Copyright (c) 2010 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_LOGIN_USERNAME_VIEW_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USERNAME_VIEW_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USERNAME_VIEW_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USERNAME_VIEW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "views/controls/label.h" | 11 #include "views/controls/label.h" |
(...skipping 18 matching lines...) Expand all Loading... |
30 static UsernameView* CreateShapedUsernameView(const std::wstring& username, | 30 static UsernameView* CreateShapedUsernameView(const std::wstring& username, |
31 bool use_small_shape); | 31 bool use_small_shape); |
32 | 32 |
33 protected: | 33 protected: |
34 // Constructs username view for the given |username|. Consider using | 34 // Constructs username view for the given |username|. Consider using |
35 // |CreateShapedUsernameView| to match the login page style. | 35 // |CreateShapedUsernameView| to match the login page style. |
36 // Empty |username| stands for guest user. | 36 // Empty |username| stands for guest user. |
37 UsernameView(const std::wstring& username, bool use_small_shape); | 37 UsernameView(const std::wstring& username, bool use_small_shape); |
38 | 38 |
39 // Overriden from views::Label. | 39 // Overriden from views::Label. |
40 virtual void OnPaint(gfx::Canvas* canvas); | 40 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; |
41 | 41 |
42 // True indicates that this UsernameView is used for a user pod not | 42 // True indicates that this UsernameView is used for a user pod not |
43 // currently selected. | 43 // currently selected. |
44 bool use_small_shape() const { return use_small_shape_; } | 44 bool use_small_shape() const { return use_small_shape_; } |
45 | 45 |
46 private: | 46 private: |
47 // Overriden from View. | 47 // Overriden from View. |
48 virtual gfx::NativeCursor GetCursorForPoint( | 48 virtual gfx::NativeCursor GetCursorForPoint(ui::EventType event_type, |
49 ui::EventType event_type, | 49 const gfx::Point& p) OVERRIDE; |
50 const gfx::Point& p); | 50 virtual void OnLocaleChanged() OVERRIDE; |
51 virtual void OnLocaleChanged(); | |
52 | 51 |
53 // Paints username to the bitmap with the bounds given. | 52 // Paints username to the bitmap with the bounds given. |
54 void PaintUsername(const gfx::Rect& bounds); | 53 void PaintUsername(const gfx::Rect& bounds); |
55 | 54 |
56 // Holds painted username. | 55 // Holds painted username. |
57 scoped_ptr<SkBitmap> text_image_; | 56 scoped_ptr<SkBitmap> text_image_; |
58 | 57 |
59 // Holds margins width (depends on the height). | 58 // Holds margins width (depends on the height). |
60 int margin_width_; | 59 int margin_width_; |
61 | 60 |
62 // Whether the shape for the smaller view should be used. | 61 // Whether the shape for the smaller view should be used. |
63 bool use_small_shape_; | 62 bool use_small_shape_; |
64 | 63 |
65 // Whether it is a guest. | 64 // Whether it is a guest. |
66 bool is_guest_; | 65 bool is_guest_; |
67 | 66 |
68 DISALLOW_COPY_AND_ASSIGN(UsernameView); | 67 DISALLOW_COPY_AND_ASSIGN(UsernameView); |
69 }; | 68 }; |
70 | 69 |
71 } // namespace chromeos | 70 } // namespace chromeos |
72 | 71 |
73 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USERNAME_VIEW_H_ | 72 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USERNAME_VIEW_H_ |
OLD | NEW |