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

Unified Diff: chrome/browser/ui/views/location_bar/background_with_1_px_border.cc

Issue 2001433002: Update appearance of omnibox focus for MD. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: share constant Created 4 years, 7 months 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
Index: chrome/browser/ui/views/location_bar/background_with_1_px_border.cc
diff --git a/chrome/browser/ui/views/location_bar/background_with_1_px_border.cc b/chrome/browser/ui/views/location_bar/background_with_1_px_border.cc
index d62f030c2fbff7fc519e645fd81fc1cb9045f2e1..8fdff449e6d6c5117867a4e62034544fdcedd03f 100644
--- a/chrome/browser/ui/views/location_bar/background_with_1_px_border.cc
+++ b/chrome/browser/ui/views/location_bar/background_with_1_px_border.cc
@@ -13,6 +13,9 @@
#include "ui/views/view.h"
#include "ui/views/widget/widget.h"
+// static
+const float BackgroundWith1PxBorder::kCornerRadius = 2.5f;
+
BackgroundWith1PxBorder::BackgroundWith1PxBorder(SkColor background,
SkColor border)
: border_color_(border) {
@@ -31,9 +34,9 @@ void BackgroundWith1PxBorder::Paint(gfx::Canvas* canvas,
border_rect_f.Inset(inset, inset);
SkPath path;
- const SkScalar kCornerRadius = SkDoubleToScalar(2.5f * scale);
- path.addRoundRect(gfx::RectFToSkRect(border_rect_f), kCornerRadius,
- kCornerRadius);
+ const SkScalar scaled_corner_radius = SkFloatToScalar(kCornerRadius * scale);
+ path.addRoundRect(gfx::RectFToSkRect(border_rect_f), scaled_corner_radius,
+ scaled_corner_radius);
SkPaint paint;
paint.setStyle(SkPaint::kStroke_Style);

Powered by Google App Engine
This is Rietveld 408576698