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

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

Issue 1394763003: Update LocationBarView Background (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update nomenclature Created 5 years, 1 month 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.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..588b3f539883563561c65a614f3e82db3de5db7c
--- /dev/null
+++ b/chrome/browser/ui/views/location_bar/background_with_1_px_border.h
@@ -0,0 +1,47 @@
+// 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. When created for popup mode, the
+// border will be a rectangle, unless the window is maximized. A maximized popup
+// will remove the horizontal edges of the border.
+//
+// When created for non popups, the border will have rounded corners.
+class BackgroundWith1PxBorder : public views::Background {
+ public:
+ BackgroundWith1PxBorder(SkColor background,
+ SkColor border,
+ bool is_popup_mode);
+
+ void Paint(gfx::Canvas* canvas, views::View* view) const override;
+
+ private:
+ // Color for the one pixel border.
+ SkColor border_color_;
+
+ // If true the border will be a rectangle, and will not render the horizontal
+ // edges when the window is maximized. If false the border will have rounded
+ // corners.
+ bool is_popup_mode_;
+
+ DISALLOW_COPY_AND_ASSIGN(BackgroundWith1PxBorder);
+};
+
+#endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_BACKGROUND_WITH_1_PX_BORDER_H_
« no previous file with comments | « chrome/browser/ui/views/layout_constants.cc ('k') | chrome/browser/ui/views/location_bar/background_with_1_px_border.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698