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

Unified Diff: chrome/browser/ui/views/autofill/autofill_dialog_views.cc

Issue 107623002: Use the NativeTheme to create the text color for text during the generated card animation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove unused header. Created 7 years 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/ui/autofill/autofill_dialog_types.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/autofill/autofill_dialog_views.cc
diff --git a/chrome/browser/ui/views/autofill/autofill_dialog_views.cc b/chrome/browser/ui/views/autofill/autofill_dialog_views.cc
index 7e10850cb555d126d0c76ec75018669b8a303175..04f33ac421cae5fb197bf8cf11dfcd60428667ec 100644
--- a/chrome/browser/ui/views/autofill/autofill_dialog_views.cc
+++ b/chrome/browser/ui/views/autofill/autofill_dialog_views.cc
@@ -35,6 +35,7 @@
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/animation/animation_delegate.h"
#include "ui/gfx/canvas.h"
+#include "ui/gfx/color_utils.h"
#include "ui/gfx/path.h"
#include "ui/gfx/point.h"
#include "ui/gfx/skia_util.h"
@@ -590,7 +591,9 @@ void AutofillDialogViews::OverlayView::UpdateState() {
message_view_->SetVisible(!state.string.text.empty());
message_view_->SetText(state.string.text);
message_view_->SetFont(state.string.font);
- message_view_->SetEnabledColor(state.string.text_color);
+ message_view_->SetEnabledColor(GetNativeTheme()->GetSystemColor(
+ ui::NativeTheme::kColorId_TextfieldReadOnlyColor));
+
message_view_->set_border(
views::Border::CreateEmptyBorder(kOverlayMessageVerticalPadding,
kDialogEdgePadding,
@@ -654,10 +657,20 @@ void AutofillDialogViews::OverlayView::OnPaint(gfx::Canvas* canvas) {
arrow.close();
SkPaint paint;
- paint.setColor(kShadingColor);
+ SkColor background_color = background()->get_color();
+ int background_luminance =
+ color_utils::GetLuminanceForColor(background_color);
+ int background_alpha = static_cast<int>(
+ 7 + 15 * (255 - background_luminance) / 255);
+ int subtle_border_alpha = static_cast<int>(
+ 10 + 20 * (255 - background_luminance) / 255);
Evan Stade 2014/01/03 02:00:55 could you at least add some commentary to explain
Sheridan Rawlins 2014/01/04 01:58:28 Done.
+
+ paint.setColor(color_utils::BlendTowardOppositeLuminance(
+ background_color, background_alpha));
paint.setStyle(SkPaint::kFill_Style);
canvas->DrawPath(arrow, paint);
- paint.setColor(kSubtleBorderColor);
+ paint.setColor(color_utils::BlendTowardOppositeLuminance(
+ background_color, subtle_border_alpha));
paint.setStyle(SkPaint::kStroke_Style);
canvas->DrawPath(arrow, paint);
}
« no previous file with comments | « chrome/browser/ui/autofill/autofill_dialog_types.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698