| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/ui/views/location_bar/location_bar_separator_view.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 #include "ui/gfx/canvas.h" |
| 9 |
| 10 LocationBarSeparatorView::LocationBarSeparatorView() |
| 11 : separator_color_(SK_ColorBLACK) { |
| 12 } |
| 13 |
| 14 LocationBarSeparatorView::~LocationBarSeparatorView() { |
| 15 } |
| 16 |
| 17 gfx::Size LocationBarSeparatorView::GetPreferredSize() { |
| 18 // Height doesn't matter. |
| 19 return gfx::Size(1, 0); |
| 20 } |
| 21 |
| 22 void LocationBarSeparatorView::OnPaint(gfx::Canvas* canvas) { |
| 23 // Note that views::Border::CreateSolidSidedBorder is not used because it |
| 24 // paints a 2-px thick border in retina display, whereas we want a 1-px thick |
| 25 // vertical line in both regular and retina displays. |
| 26 SkPaint paint; |
| 27 paint.setAntiAlias(false); |
| 28 paint.setStrokeWidth(0); |
| 29 paint.setColor(separator_color_); |
| 30 canvas->DrawLine(gfx::Point(0, 0), gfx::Point(0, height()), paint); |
| 31 } |
| OLD | NEW |