Index: chrome/browser/ui/views/location_bar/background_with_1_px_border.h |
diff --git a/chrome/browser/ui/views/location_bar/background_with_1_px_border.h b/chrome/browser/ui/views/location_bar/background_with_1_px_border.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..7cee7b4808a3c7291fdf4a398f2a21d885925ed8 |
--- /dev/null |
+++ b/chrome/browser/ui/views/location_bar/background_with_1_px_border.h |
@@ -0,0 +1,42 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_BACKGROUND_WITH_1_PX_BORDER_H_ |
+#define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_BACKGROUND_WITH_1_PX_BORDER_H_ |
+ |
+#include "base/macros.h" |
+#include "third_party/skia/include/core/SkColor.h" |
+#include "ui/views/background.h" |
+ |
+namespace gfx { |
+class Canvas; |
+} |
+ |
+namespace views { |
+class View; |
+} |
+ |
+// BackgroundWith1PxBorder renders a solid background color, with a one pixel |
+// border. This accounts for the scaling of the canvas, so that the border is |
+// one pixel regardless of display scaling. Optionally the border can have |
+// rounded corners. |
+class BackgroundWith1PxBorder : public views::Background { |
+ public: |
+ BackgroundWith1PxBorder(SkColor background, |
+ SkColor border, |
+ bool round_corners); |
+ |
+ void Paint(gfx::Canvas* canvas, views::View* view) const override; |
+ |
+ private: |
+ // Color for the one pixel border. |
+ SkColor border_color_; |
+ |
+ // If true the border and interior corners will be rounded. |
+ bool round_corners_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(BackgroundWith1PxBorder); |
+}; |
+ |
+#endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_BACKGROUND_WITH_1_PX_BORDER_H_ |