Chromium Code Reviews| 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..99f0248ddd4044439068ad1426e7a821a32db07f |
| --- /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) { |
|
Peter Kasting
2013/01/17 04:14:22
Nit: Indent 4
kuan
2013/01/17 17:57:43
Done.
|
| +} |
| + |
| +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); |
| +} |