username_view.h revision 731df977c0511bca2206b5f333555b1205ff1f43
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 3// found in the LICENSE file. 4 5#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USERNAME_VIEW_H_ 6#define CHROME_BROWSER_CHROMEOS_LOGIN_USERNAME_VIEW_H_ 7#pragma once 8 9#include <string> 10 11#include "views/view.h" 12 13namespace gfx { 14class Font; 15} // namespace gfx 16 17namespace views { 18class Label; 19} // namespace views 20 21namespace chromeos { 22// View that contains two parts. First one is a label with username, second one 23// is an empty view with gradient transparency background. 24class UsernameView : public views::View { 25 public: 26 explicit UsernameView(const std::wstring& username); 27 virtual ~UsernameView() {} 28 29 // Set the font of the username text. 30 void SetFont(const gfx::Font& font); 31 32 // Returns username label. 33 views::Label* label() const { 34 return label_; 35 } 36 37 // views::View overrides. 38 virtual void Layout(); 39 virtual gfx::Size GetPreferredSize(); 40 41 private: 42 views::Label* label_; 43 views::View* gradient_; 44 45 DISALLOW_COPY_AND_ASSIGN(UsernameView); 46}; 47 48} // namespace chromeos 49 50#endif // CHROME_BROWSER_CHROMEOS_LOGIN_USERNAME_VIEW_H_ 51