diff options
author | dbeam@chromium.org <dbeam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-01 20:31:56 +0000 |
---|---|---|
committer | dbeam@chromium.org <dbeam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-01 20:31:56 +0000 |
commit | 718948b89242c630e2c77571c66c75dd4515822a (patch) | |
tree | 2e413e3c11929f685ba0dff566e9a331c0ea3cad | |
parent | 62b9f8b71f4af4b70eb35ca831d8b282be0d2c12 (diff) | |
download | chromium_src-718948b89242c630e2c77571c66c75dd4515822a.zip chromium_src-718948b89242c630e2c77571c66c75dd4515822a.tar.gz chromium_src-718948b89242c630e2c77571c66c75dd4515822a.tar.bz2 |
rAc(): Make notification area colors match mocks.
- DialogNotification:
- Change GetBackgroundColor() to match mocks.
- Add GetTextColor() and uses it in AutofillDialogViews.
R=sky@chromium.org
BUG=163508,170397
Review URL: https://codereview.chromium.org/12092101
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180181 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/ui/autofill/autofill_dialog_types.cc | 23 | ||||
-rw-r--r-- | chrome/browser/ui/autofill/autofill_dialog_types.h | 5 | ||||
-rw-r--r-- | chrome/browser/ui/views/autofill/autofill_dialog_views.cc | 5 |
3 files changed, 26 insertions, 7 deletions
diff --git a/chrome/browser/ui/autofill/autofill_dialog_types.cc b/chrome/browser/ui/autofill/autofill_dialog_types.cc index a740374..eaf5583 100644 --- a/chrome/browser/ui/autofill/autofill_dialog_types.cc +++ b/chrome/browser/ui/autofill/autofill_dialog_types.cc @@ -16,13 +16,30 @@ DialogNotification::DialogNotification(Type type, const string16& display_text) SkColor DialogNotification::GetBackgroundColor() const { switch (type_) { case DialogNotification::SUBMISSION_OPTION: - return SK_ColorBLUE; + return SkColorSetRGB(0x47, 0x89, 0xfa); case DialogNotification::REQUIRED_ACTION: - return SK_ColorGRAY; + case DialogNotification::WALLET_ERROR: + return SkColorSetRGB(0xfc, 0xf3, 0xbf); case DialogNotification::SECURITY_WARNING: case DialogNotification::VALIDATION_ERROR: + return SkColorSetRGB(0xde, 0x49, 0x32); + case DialogNotification::NONE: + return SK_ColorTRANSPARENT; + } + + NOTREACHED(); + return SK_ColorTRANSPARENT; +} + +SkColor DialogNotification::GetTextColor() const { + switch (type_) { + case DialogNotification::REQUIRED_ACTION: case DialogNotification::WALLET_ERROR: - return SK_ColorRED; + return SK_ColorBLACK; + case DialogNotification::SUBMISSION_OPTION: + case DialogNotification::SECURITY_WARNING: + case DialogNotification::VALIDATION_ERROR: + return SK_ColorWHITE; case DialogNotification::NONE: return SK_ColorTRANSPARENT; } diff --git a/chrome/browser/ui/autofill/autofill_dialog_types.h b/chrome/browser/ui/autofill/autofill_dialog_types.h index 050cf58..04653b6 100644 --- a/chrome/browser/ui/autofill/autofill_dialog_types.h +++ b/chrome/browser/ui/autofill/autofill_dialog_types.h @@ -66,9 +66,10 @@ class DialogNotification { DialogNotification(); DialogNotification(Type type, const string16& display_text); - // Returns the appropriate background color for the view's notification area - // based on |type_|. + // Returns the appropriate background or text color for the view's + // notification area based on |type_|. SkColor GetBackgroundColor() const; + SkColor GetTextColor() const; const string16& display_text() const { return display_text_; } diff --git a/chrome/browser/ui/views/autofill/autofill_dialog_views.cc b/chrome/browser/ui/views/autofill/autofill_dialog_views.cc index 4a193da..4b2fa5e 100644 --- a/chrome/browser/ui/views/autofill/autofill_dialog_views.cc +++ b/chrome/browser/ui/views/autofill/autofill_dialog_views.cc @@ -623,10 +623,11 @@ void AutofillDialogViews::UpdateNotificationArea() { const DialogNotification& notification = controller_->CurrentNotification(); const string16& display_text = notification.display_text(); - notification_label_->parent()->SetVisible(!display_text.empty()); notification_label_->SetVisible(!display_text.empty()); - + notification_label_->SetEnabledColor(notification.GetTextColor()); notification_label_->SetText(display_text); + + notification_label_->parent()->SetVisible(!display_text.empty()); notification_label_->parent()->background()->SetNativeControlColor( notification.GetBackgroundColor()); |