Commit 4c4332ec authored by oshima@chromium.org's avatar oshima@chromium.org

Update screen locker UI to match webui login

 remove all rounded corders in the pod.
 add 1x border around pod
 change background to c0c0c0.

BUG=chromium-os:20652
TEST=see bug for new ui mock


Review URL: http://codereview.chromium.org/7980029

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102230 0039d316-1c4b-4281-b951-d872f2087c98
parent b05c3dbf
......@@ -12,7 +12,6 @@
#include "base/stringprintf.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chromeos/login/helper.h"
#include "chrome/browser/chromeos/login/login_utils.h"
#include "chrome/browser/chromeos/login/oobe_progress_bar.h"
#include "chrome/browser/chromeos/login/proxy_settings_dialog.h"
......@@ -48,6 +47,9 @@ namespace {
const SkColor kVersionColor = 0xff5c739f;
// Tentative background color that matches WebUI login.
const SkColor kBackgroundColor = 0xfff0f0f0;
// Returns the corresponding step id for step constant.
int GetStepId(size_t step) {
switch (step) {
......@@ -94,8 +96,8 @@ BackgroundView::~BackgroundView() {
}
void BackgroundView::Init(const GURL& background_url) {
views::Painter* painter = CreateBackgroundPainter();
set_background(views::Background::CreateBackgroundPainter(true, painter));
set_background(
views::Background::CreateSolidBackground(kBackgroundColor));
InitStatusArea();
InitInfoLabels();
if (!background_url.is_empty()) {
......
......@@ -124,13 +124,10 @@ void ScreenLockView::Init() {
false, // is_login
true); // need_background
main_ = new views::View();
// Use rounded rect background.
views::Painter* painter =
CreateWizardPainter(&BorderDefinition::kUserBorder);
main_->set_background(
views::Background::CreateBackgroundPainter(true, painter));
main_->set_border(CreateWizardBorder(&BorderDefinition::kUserBorder));
views::Background::CreateVerticalGradientBackground(
BorderDefinition::kUserBorder.top_color,
BorderDefinition::kUserBorder.bottom_color));
// Password field.
password_field_ = new PasswordField();
......
......@@ -7,7 +7,6 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/chromeos/login/helper.h"
#include "chrome/browser/chromeos/login/rounded_rect_painter.h"
#include "chrome/browser/chromeos/login/rounded_view.h"
#include "chrome/browser/chromeos/view_ids.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources_standard.h"
......@@ -30,13 +29,15 @@ namespace {
// Background color and corner radius of the login status label and
// signout button.
const SkColor kSignoutBackgroundColor = 0xFF007700;
const int kSignoutBackgroundCornerRadius = 4;
// Horiz/Vert insets for Signout view.
const int kSignoutViewHorizontalInsets = 10;
const int kSignoutViewVerticalInsets = 5;
const int kMinControlHeight = 16;
// 1x Border around image pod.
const SkColor kImageBorderColor = 0xFFCCCCCC;
// Padding between remove button and top right image corner.
const int kRemoveButtonPadding = 3;
......@@ -46,8 +47,7 @@ class SignoutBackgroundPainter : public views::Painter {
virtual void Paint(int w, int h, gfx::Canvas* canvas) {
SkRect rect = {0, 0, w, h};
SkPath path;
path.addRoundRect(rect,
kSignoutBackgroundCornerRadius, kSignoutBackgroundCornerRadius);
path.addRect(rect);
SkPaint paint;
paint.setStyle(SkPaint::kFill_Style);
paint.setFlags(SkPaint::kAntiAlias_Flag);
......@@ -258,10 +258,9 @@ UserView::UserView(Delegate* delegate, bool is_login, bool need_background)
if (!is_login)
signout_view_ = new SignoutView(this);
if (need_background)
image_view_ = new RoundedView<PodImageView>(delegate);
else
image_view_ = new PodImageView(delegate);
image_view_ = new PodImageView(delegate);
image_view_->set_border(
views::Border::CreateSolidBorder(1, kImageBorderColor));
Init(need_background);
}
......
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment