Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(574)

Unified Diff: chrome/browser/chromeos/login/username_view.cc

Issue 7980029: Update screen locker UI to match webui login (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/login/user_view.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/username_view.cc
diff --git a/chrome/browser/chromeos/login/username_view.cc b/chrome/browser/chromeos/login/username_view.cc
index 9efc69e311039dd921c31126ccd921b5e6a5be37..34f657ed796b2509a7b1dc37860a2cba15851260 100644
--- a/chrome/browser/chromeos/login/username_view.cc
+++ b/chrome/browser/chromeos/login/username_view.cc
@@ -28,50 +28,6 @@ const double kMarginRatio = 1.0 / 3.0;
// Holds the frame width for the small shaped username view.
const SkScalar kSmallShapeFrameWidth = SkIntToScalar(1);
-// Class that sets up half rounded rectangle (only the bottom corners are
-// rounded) as a clip region of the view.
-// For more info see the file "chrome/browser/chromeos/login/rounded_view.h".
-template<typename C>
-class HalfRoundedView : public RoundedView<C> {
- public:
- HalfRoundedView(const std::wstring &text, bool use_small_shape)
- : RoundedView<C>(text, use_small_shape) {
- }
-
- protected:
- // Overrides ViewFilter.
- virtual SkPath GetClipPath() const {
- if (!C::use_small_shape()) {
- return RoundedView<C>::GetClipPath();
- } else {
- SkPath path;
- gfx::Rect frame_bounds = this->bounds();
- frame_bounds.Inset(kSmallShapeFrameWidth, kSmallShapeFrameWidth,
- kSmallShapeFrameWidth, kSmallShapeFrameWidth);
- path.addRect(SkIntToScalar(frame_bounds.x()),
- SkIntToScalar(frame_bounds.y()),
- SkIntToScalar(frame_bounds.x() + frame_bounds.width()),
- SkIntToScalar(frame_bounds.y() + frame_bounds.height()));
- return path;
- }
- }
-
- virtual void DrawFrame(gfx::Canvas* canvas) {
- // No frame is needed.
- }
-
- virtual SkRect GetViewRect() const {
- SkRect view_rect;
- // The rectangle will be intersected with the bounds, so the correct half
- // of the round rectangle will be obtained.
- view_rect.iset(this->x(),
- this->y() - this->height(),
- this->x() + this->width(),
- this->y() + this->height());
- return view_rect;
- }
-};
-
} // namespace
UsernameView::UsernameView(const std::wstring& username, bool use_small_shape)
@@ -96,7 +52,7 @@ void UsernameView::OnPaint(gfx::Canvas* canvas) {
// static
UsernameView* UsernameView::CreateShapedUsernameView(
const std::wstring& username, bool use_small_shape) {
- return new HalfRoundedView<UsernameView>(username, use_small_shape);
+ return new UsernameView(username, use_small_shape);
}
gfx::NativeCursor UsernameView::GetCursor(const views::MouseEvent& event) {
« no previous file with comments | « chrome/browser/chromeos/login/user_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698