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

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

Issue 2555623002: Last round of cleaning up MD layout constants. (Closed)
Patch Set: pkasting review, remove debug code, rebase Created 4 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
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 d489a3b20066b066e63f66ce8334654067216182..82f522647e63a1d1f66e73e59c2b1cdf4f87a7df 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
@@ -4,7 +4,6 @@
#include "chrome/browser/ui/views/location_bar/background_with_1_px_border.h"
-#include "chrome/browser/ui/layout_constants.h"
#include "third_party/skia/include/core/SkPaint.h"
#include "third_party/skia/include/core/SkPath.h"
#include "third_party/skia/include/pathops/SkPathOps.h"
@@ -27,14 +26,13 @@ void BackgroundWith1PxBorder::Paint(gfx::Canvas* canvas,
const float scale = canvas->UndoDeviceScaleFactor();
border_rect_f.Scale(scale);
// Draw the border as a 1px thick line aligned with the inside edge of the
- // LOCATION_BAR_BORDER_THICKNESS region. This line needs to be snapped to the
+ // kLocationBarBorderThicknessDip region. This line needs to be snapped to the
// pixel grid, so the result of the scale-up needs to be snapped to an integer
// value. Using floor() instead of round() ensures that, for non-integral
// scale factors, the border will still be drawn inside the BORDER_THICKNESS
// region instead of being partially inside it.
- border_rect_f.Inset(gfx::InsetsF(
- std::floor(GetLayoutConstant(LOCATION_BAR_BORDER_THICKNESS) * scale) -
- 0.5f));
+ border_rect_f.Inset(
+ gfx::InsetsF(std::floor(kLocationBarBorderThicknessDip * scale) - 0.5f));
SkPath path;
const SkScalar scaled_corner_radius =

Powered by Google App Engine
This is Rietveld 408576698