| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/views/location_bar/keyword_hint_view.h" | 5 #include "chrome/browser/ui/views/location_bar/keyword_hint_view.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 TabKeyBubbleView::TabKeyBubbleView() | 50 TabKeyBubbleView::TabKeyBubbleView() |
| 51 : views::Label(l10n_util::GetStringUTF16(IDS_APP_TAB_KEY)) { | 51 : views::Label(l10n_util::GetStringUTF16(IDS_APP_TAB_KEY)) { |
| 52 SetBorder(views::Border::CreateEmptyBorder( | 52 SetBorder(views::Border::CreateEmptyBorder( |
| 53 gfx::Insets(GetLayoutConstant(LOCATION_BAR_BUBBLE_VERTICAL_PADDING), 0))); | 53 gfx::Insets(GetLayoutConstant(LOCATION_BAR_BUBBLE_VERTICAL_PADDING), 0))); |
| 54 } | 54 } |
| 55 | 55 |
| 56 TabKeyBubbleView::~TabKeyBubbleView() {} | 56 TabKeyBubbleView::~TabKeyBubbleView() {} |
| 57 | 57 |
| 58 gfx::Size TabKeyBubbleView::GetPreferredSize() const { | 58 gfx::Size TabKeyBubbleView::GetPreferredSize() const { |
| 59 gfx::Size size = views::Label::GetPreferredSize(); | 59 gfx::Size size = views::Label::GetPreferredSize(); |
| 60 size.Enlarge(2 * GetLayoutConstant(ICON_LABEL_VIEW_TRAILING_PADDING), 0); | 60 constexpr int kPaddingInsideBorder = 5; |
| 61 // Even though the border is 1 px thick visibly, it takes 1 DIP logically. |
| 62 size.Enlarge(2 * (kPaddingInsideBorder + 1), 0); |
| 61 return size; | 63 return size; |
| 62 } | 64 } |
| 63 | 65 |
| 64 } // namespace | 66 } // namespace |
| 65 | 67 |
| 66 KeywordHintView::KeywordHintView(Profile* profile, | 68 KeywordHintView::KeywordHintView(Profile* profile, |
| 67 const gfx::FontList& font_list, | 69 const gfx::FontList& font_list, |
| 68 const gfx::FontList& bubble_font_list, | 70 const gfx::FontList& bubble_font_list, |
| 69 int bubble_height, | 71 int bubble_height, |
| 70 SkColor text_color, | 72 SkColor text_color, |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 | 162 |
| 161 views::Label* KeywordHintView::CreateLabel(const gfx::FontList& font_list, | 163 views::Label* KeywordHintView::CreateLabel(const gfx::FontList& font_list, |
| 162 SkColor text_color, | 164 SkColor text_color, |
| 163 SkColor background_color) { | 165 SkColor background_color) { |
| 164 views::Label* label = new views::Label(base::string16(), font_list); | 166 views::Label* label = new views::Label(base::string16(), font_list); |
| 165 label->SetEnabledColor(text_color); | 167 label->SetEnabledColor(text_color); |
| 166 label->SetBackgroundColor(background_color); | 168 label->SetBackgroundColor(background_color); |
| 167 AddChildView(label); | 169 AddChildView(label); |
| 168 return label; | 170 return label; |
| 169 } | 171 } |
| OLD | NEW |