| Index: chrome/browser/chromeos/login/new_user_view.cc
|
| ===================================================================
|
| --- chrome/browser/chromeos/login/new_user_view.cc (revision 104769)
|
| +++ chrome/browser/chromeos/login/new_user_view.cc (working copy)
|
| @@ -31,6 +31,7 @@
|
| #include "ui/base/keycodes/keyboard_codes.h"
|
| #include "ui/base/l10n/l10n_util.h"
|
| #include "ui/base/resource/resource_bundle.h"
|
| +#include "ui/gfx/color_utils.h"
|
| #include "ui/gfx/font.h"
|
| #include "views/controls/button/menu_button.h"
|
| #include "views/controls/button/text_button.h"
|
| @@ -141,14 +142,6 @@
|
| }
|
|
|
| void NewUserView::Init() {
|
| - if (need_border_) {
|
| - // Use rounded rect background.
|
| - set_border(CreateWizardBorder(&BorderDefinition::kUserBorder));
|
| - views::Painter* painter = CreateWizardPainter(
|
| - &BorderDefinition::kUserBorder);
|
| - set_background(views::Background::CreateBackgroundPainter(true, painter));
|
| - }
|
| -
|
| title_label_ = new views::Label();
|
| title_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT);
|
| title_label_->SetMultiLine(true);
|
| @@ -156,7 +149,7 @@
|
|
|
| title_hint_label_ = new views::Label();
|
| title_hint_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT);
|
| - title_hint_label_->SetColor(SK_ColorGRAY);
|
| + title_hint_label_->SetEnabledColor(SK_ColorGRAY);
|
| title_hint_label_->SetMultiLine(true);
|
| AddChildView(title_hint_label_);
|
|
|
| @@ -188,6 +181,34 @@
|
| }
|
| AddChildView(languages_menubutton_);
|
|
|
| + if (need_border_) {
|
| + // Use rounded rect background.
|
| + set_border(CreateWizardBorder(&BorderDefinition::kUserBorder));
|
| + views::Painter* painter = CreateWizardPainter(
|
| + &BorderDefinition::kUserBorder);
|
| + set_background(views::Background::CreateBackgroundPainter(true, painter));
|
| + SkColor background_color = color_utils::AlphaBlend(
|
| + BorderDefinition::kUserBorder.top_color,
|
| + BorderDefinition::kUserBorder.bottom_color, 128);
|
| + title_label_->SetBackgroundColor(background_color);
|
| + title_hint_label_->SetBackgroundColor(background_color);
|
| + if (guest_link_)
|
| + guest_link_->SetBackgroundColor(background_color);
|
| + if (create_account_link_)
|
| + guest_link_->SetBackgroundColor(background_color);
|
| + } else {
|
| + // In theory, we should actually set the real background color for all the
|
| + // labels and links whether or not |need_border_| is set, but since without
|
| + // it the background color is non-obvious, just disable auto color
|
| + // readability.
|
| + title_label_->SetAutoColorReadabilityEnabled(false);
|
| + title_hint_label_->SetAutoColorReadabilityEnabled(false);
|
| + if (guest_link_)
|
| + guest_link_->SetAutoColorReadabilityEnabled(false);
|
| + if (create_account_link_)
|
| + create_account_link_->SetAutoColorReadabilityEnabled(false);
|
| + }
|
| +
|
| // Set up accelerators.
|
| AddAccelerator(accel_focus_user_);
|
| AddAccelerator(accel_focus_pass_);
|
| @@ -560,20 +581,18 @@
|
| }
|
|
|
| bool NewUserView::NavigateAway() {
|
| - if (username_field_->text().empty() &&
|
| - password_field_->text().empty()) {
|
| - delegate_->NavigateAway();
|
| - return true;
|
| - } else {
|
| + if (!username_field_->text().empty() ||
|
| + !password_field_->text().empty())
|
| return false;
|
| - }
|
| + delegate_->NavigateAway();
|
| + return true;
|
| }
|
|
|
| void NewUserView::InitLink(views::Link** link) {
|
| *link = new views::Link(string16());
|
| (*link)->set_listener(this);
|
| - (*link)->SetNormalColor(login::kLinkColor);
|
| - (*link)->SetHighlightedColor(login::kLinkColor);
|
| + (*link)->SetEnabledColor(login::kLinkColor);
|
| + (*link)->SetPressedColor(login::kLinkColor);
|
| AddChildView(*link);
|
| }
|
|
|
|
|