OLD | NEW |
1 // Copyright (c) 2011 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_USER_VIEW_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USER_VIEW_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USER_VIEW_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USER_VIEW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 virtual void OnLocaleChanged() {} | 46 virtual void OnLocaleChanged() {} |
47 }; | 47 }; |
48 | 48 |
49 // Creates UserView for login screen (|is_login| == true) or screen locker. | 49 // Creates UserView for login screen (|is_login| == true) or screen locker. |
50 // On login screen this will have remove button. | 50 // On login screen this will have remove button. |
51 // On screen locker it will have sign out button. |need_background| is needed | 51 // On screen locker it will have sign out button. |need_background| is needed |
52 // to show image with transparent areas. | 52 // to show image with transparent areas. |
53 UserView(Delegate* delegate, bool is_login, bool need_background); | 53 UserView(Delegate* delegate, bool is_login, bool need_background); |
54 | 54 |
55 // view::View overrides. | 55 // view::View overrides. |
56 virtual gfx::Size GetPreferredSize(); | 56 virtual gfx::Size GetPreferredSize() OVERRIDE; |
57 virtual void OnLocaleChanged(); | 57 virtual void OnLocaleChanged() OVERRIDE; |
58 | 58 |
59 // Sets the user's image. If image's size is less than | 59 // Sets the user's image. If image's size is less than |
60 // 75% of window size, image size is preserved to avoid blur. Otherwise, | 60 // 75% of window size, image size is preserved to avoid blur. Otherwise, |
61 // the image is resized to fit window size precisely. Image view repaints | 61 // the image is resized to fit window size precisely. Image view repaints |
62 // itself. | 62 // itself. |
63 void SetImage(const SkBitmap& image, const SkBitmap& image_hot); | 63 void SetImage(const SkBitmap& image, const SkBitmap& image_hot); |
64 | 64 |
65 // Sets tooltip over the image. | 65 // Sets tooltip over the image. |
66 void SetTooltipText(const std::wstring& text); | 66 void SetTooltipText(const std::wstring& text); |
67 | 67 |
68 // Show/Hide remove button. | 68 // Show/Hide remove button. |
69 void SetRemoveButtonVisible(bool flag); | 69 void SetRemoveButtonVisible(bool flag); |
70 | 70 |
71 // Enable/Disable sign-out button. | 71 // Enable/Disable sign-out button. |
72 void SetSignoutEnabled(bool enabled); | 72 void SetSignoutEnabled(bool enabled); |
73 | 73 |
74 // Implements views::LinkListener. | 74 // Implements views::LinkListener. |
75 // Called when a signout link is clicked. | 75 // Called when a signout link is clicked. |
76 virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE; | 76 virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE; |
77 | 77 |
78 // Overridden from views::ButtonListener. | 78 // Overridden from views::ButtonListener. |
79 virtual void ButtonPressed(views::Button* sender, const views::Event& event); | 79 virtual void ButtonPressed(views::Button* sender, |
| 80 const views::Event& event) OVERRIDE; |
80 | 81 |
81 private: | 82 private: |
82 void Init(bool need_background); | 83 void Init(bool need_background); |
83 | 84 |
84 Delegate* delegate_; | 85 Delegate* delegate_; |
85 | 86 |
86 SignoutView* signout_view_; | 87 SignoutView* signout_view_; |
87 PodImageView* image_view_; | 88 PodImageView* image_view_; |
88 | 89 |
89 views::TextButton* remove_button_; | 90 views::TextButton* remove_button_; |
90 | 91 |
91 DISALLOW_COPY_AND_ASSIGN(UserView); | 92 DISALLOW_COPY_AND_ASSIGN(UserView); |
92 }; | 93 }; |
93 | 94 |
94 } // chromeos | 95 } // chromeos |
95 | 96 |
96 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_VIEW_H_ | 97 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USER_VIEW_H_ |
OLD | NEW |