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

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: Grow alpha for shading & border of overlay background as it approaches black. 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_view_delegate.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 64cdc04ed63cc020151b1ca1b0341054cbb538e3..7f979d4316fb50974ac31416f7471a7e4c65e039 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"
@@ -578,7 +579,8 @@ int AutofillDialogViews::OverlayView::GetHeightForContentsForWidth(int width) {
}
void AutofillDialogViews::OverlayView::UpdateState() {
- const DialogOverlayState& state = delegate_->GetDialogOverlay();
+ const DialogOverlayState& state =
+ delegate_->GetDialogOverlay(GetNativeTheme());
if (state.image.IsEmpty()) {
SetVisible(false);
@@ -654,10 +656,19 @@ 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 * (background_luminance - 255) / 255);
groby-ooo-7-16 2013/12/10 20:26:49 So we get a negative alpha for high-luma backgroun
Sheridan Rawlins 2013/12/10 20:51:56 No, alpha is always positive - the luminance retur
+ int subtle_border_alpha = static_cast<int>(
+ 10 - 20 * (background_luminance - 255) / 255);
+
+ 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_view_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698