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

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

Issue 11418229: alternate ntp: implement right-aligned search token (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed nits from peter Created 7 years, 11 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/location_bar_separator_view.cc
diff --git a/chrome/browser/ui/views/location_bar/location_bar_separator_view.cc b/chrome/browser/ui/views/location_bar/location_bar_separator_view.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f78fd9abd09e14cc7f9d4ad13b25a66d5c473192
--- /dev/null
+++ b/chrome/browser/ui/views/location_bar/location_bar_separator_view.cc
@@ -0,0 +1,31 @@
+// Copyright (c) 2013 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.
+
+#include "chrome/browser/ui/views/location_bar/location_bar_separator_view.h"
+
+#include "base/logging.h"
+#include "ui/gfx/canvas.h"
+
+LocationBarSeparatorView::LocationBarSeparatorView()
+ : separator_color_(SK_ColorBLACK) {
+}
+
+LocationBarSeparatorView::~LocationBarSeparatorView() {
+}
+
+gfx::Size LocationBarSeparatorView::GetPreferredSize() {
+ // Height doesn't matter.
+ return gfx::Size(1, 0);
+}
+
+void LocationBarSeparatorView::OnPaint(gfx::Canvas* canvas) {
+ // Note that views::Border::CreateSolidSidedBorder is not used because it
+ // paints a 2-px thick border in retina display, whereas we want a 1-px thick
+ // vertical line in both regular and retina displays.
+ SkPaint paint;
+ paint.setAntiAlias(false);
+ paint.setStrokeWidth(0);
+ paint.setColor(separator_color_);
+ canvas->DrawLine(gfx::Point(0, 0), gfx::Point(0, height()), paint);
+}

Powered by Google App Engine
This is Rietveld 408576698