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

Side by Side Diff: chrome/browser/ui/views/location_bar/keyword_hint_view.cc

Issue 2734113006: "Bootstrap" a toolkit-views Typography spec. (Closed)
Patch Set: Rebase (conflict in layout_delegate.h due to r457774) Created 3 years, 9 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 unified diff | Download patch
OLDNEW
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 19 matching lines...) Expand all
30 ~TabKeyBubbleView() override; 30 ~TabKeyBubbleView() override;
31 31
32 private: 32 private:
33 // views::Label: 33 // views::Label:
34 gfx::Size GetPreferredSize() const override; 34 gfx::Size GetPreferredSize() const override;
35 35
36 DISALLOW_COPY_AND_ASSIGN(TabKeyBubbleView); 36 DISALLOW_COPY_AND_ASSIGN(TabKeyBubbleView);
37 }; 37 };
38 38
39 TabKeyBubbleView::TabKeyBubbleView(const gfx::FontList& font_list) 39 TabKeyBubbleView::TabKeyBubbleView(const gfx::FontList& font_list)
40 : views::Label(l10n_util::GetStringUTF16(IDS_APP_TAB_KEY), font_list) { 40 : views::Label(l10n_util::GetStringUTF16(IDS_APP_TAB_KEY), {font_list}) {
41 SetBorder(views::CreateEmptyBorder( 41 SetBorder(views::CreateEmptyBorder(
42 gfx::Insets(LocationBarView::kBubbleVerticalPadding, 0))); 42 gfx::Insets(LocationBarView::kBubbleVerticalPadding, 0)));
43 } 43 }
44 44
45 TabKeyBubbleView::~TabKeyBubbleView() {} 45 TabKeyBubbleView::~TabKeyBubbleView() {}
46 46
47 gfx::Size TabKeyBubbleView::GetPreferredSize() const { 47 gfx::Size TabKeyBubbleView::GetPreferredSize() const {
48 gfx::Size size = views::Label::GetPreferredSize(); 48 gfx::Size size = views::Label::GetPreferredSize();
49 constexpr int kPaddingInsideBorder = 5; 49 constexpr int kPaddingInsideBorder = 5;
50 // Even though the border is 1 px thick visibly, it takes 1 DIP logically. 50 // Even though the border is 1 px thick visibly, it takes 1 DIP logically.
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 show_labels ? trailing_size.width() : 0, height()); 137 show_labels ? trailing_size.width() : 0, height());
138 } 138 }
139 139
140 const char* KeywordHintView::GetClassName() const { 140 const char* KeywordHintView::GetClassName() const {
141 return "KeywordHintView"; 141 return "KeywordHintView";
142 } 142 }
143 143
144 views::Label* KeywordHintView::CreateLabel(const gfx::FontList& font_list, 144 views::Label* KeywordHintView::CreateLabel(const gfx::FontList& font_list,
145 SkColor text_color, 145 SkColor text_color,
146 SkColor background_color) { 146 SkColor background_color) {
147 views::Label* label = new views::Label(base::string16(), font_list); 147 views::Label* label = new views::Label(base::string16(), {font_list});
148 label->SetEnabledColor(text_color); 148 label->SetEnabledColor(text_color);
149 label->SetBackgroundColor(background_color); 149 label->SetBackgroundColor(background_color);
150 AddChildView(label); 150 AddChildView(label);
151 return label; 151 return label;
152 } 152 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698