Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 30 // to match the shape of the scaled frame of the user image. The caller gets | 30 // to match the shape of the scaled frame of the user image. The caller gets |
| 31 // the ownership. | 31 // the ownership. |
| 32 static UsernameView* CreateShapedUsernameView(const std::wstring& username, | 32 static UsernameView* CreateShapedUsernameView(const std::wstring& username, |
| 33 bool use_small_shape); | 33 bool use_small_shape); |
| 34 | 34 |
| 35 protected: | 35 protected: |
| 36 // Constructs username view for the given |username|. Consider using | 36 // Constructs username view for the given |username|. Consider using |
| 37 // |CreateShapedUsernameView| to match the login page style. | 37 // |CreateShapedUsernameView| to match the login page style. |
| 38 explicit UsernameView(const std::wstring& username); | 38 explicit UsernameView(const std::wstring& username); |
| 39 | 39 |
| 40 void set_use_small_shape(bool use) { use_small_shape_ = use; } | |
| 41 bool get_use_small_shape() const { return use_small_shape_; } | |
|
Dmitry Polukhin
2010/12/27 08:25:06
Getter shoudn't have get in its name. Comment abou
glotov
2010/12/30 15:54:52
Done.
| |
| 42 | |
| 40 private: | 43 private: |
| 44 // Overriden from View. | |
| 45 gfx::NativeCursor GetCursorForPoint( | |
| 46 views::Event::EventType event_type, | |
| 47 const gfx::Point& p); | |
| 41 | 48 |
| 42 // Paints username to the bitmap with the bounds given. | 49 // Paints username to the bitmap with the bounds given. |
| 43 void PaintUsername(const gfx::Rect& bounds); | 50 void PaintUsername(const gfx::Rect& bounds); |
| 44 | 51 |
| 45 // Holds painted username. | 52 // Holds painted username. |
| 46 scoped_ptr<SkBitmap> text_image_; | 53 scoped_ptr<SkBitmap> text_image_; |
| 47 | 54 |
| 48 // Holds margins width (depends on the height). | 55 // Holds margins width (depends on the height). |
| 49 int margin_width_; | 56 int margin_width_; |
| 50 | 57 |
| 58 // Whether the shape for the smaller view should be used. | |
| 59 bool use_small_shape_; | |
| 60 | |
| 51 DISALLOW_COPY_AND_ASSIGN(UsernameView); | 61 DISALLOW_COPY_AND_ASSIGN(UsernameView); |
| 52 }; | 62 }; |
| 53 | 63 |
| 54 } // namespace chromeos | 64 } // namespace chromeos |
| 55 | 65 |
| 56 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USERNAME_VIEW_H_ | 66 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USERNAME_VIEW_H_ |
| OLD | NEW |