OLD | NEW |
| (Empty) |
1 // Copyright (c) 2012 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/touchable_location_bar_view.h" | |
6 | |
7 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | |
8 #include "ui/base/layout.h" | |
9 #include "ui/views/border.h" | |
10 | |
11 // static | |
12 void TouchableLocationBarView::Init(views::View* view) { | |
13 int horizontal_padding = GetBuiltInHorizontalPaddingImpl(); | |
14 if (horizontal_padding != 0) { | |
15 view->set_border(views::Border::CreateEmptyBorder( | |
16 3, horizontal_padding, 3, horizontal_padding)); | |
17 } | |
18 } | |
19 | |
20 // static | |
21 int TouchableLocationBarView::GetBuiltInHorizontalPaddingImpl() { | |
22 return ui::GetDisplayLayout() == ui::LAYOUT_TOUCH ? | |
23 LocationBarView::GetItemPadding() / 2 : 0; | |
24 } | |
OLD | NEW |