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

Side by Side Diff: ui/views/controls/label.cc

Issue 2765883004: Implement Harmony typography spec. (Closed)
Patch Set: respond to comments Created 3 years, 8 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
« no previous file with comments | « ui/views/controls/button/label_button.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/views/controls/label.h" 5 #include "ui/views/controls/label.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <cmath> 10 #include <cmath>
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 Label::Label() : Label(base::string16()) { 43 Label::Label() : Label(base::string16()) {
44 } 44 }
45 45
46 Label::Label(const base::string16& text) 46 Label::Label(const base::string16& text)
47 : Label(text, style::CONTEXT_LABEL, style::STYLE_PRIMARY) {} 47 : Label(text, style::CONTEXT_LABEL, style::STYLE_PRIMARY) {}
48 48
49 Label::Label(const base::string16& text, int text_context, int text_style) 49 Label::Label(const base::string16& text, int text_context, int text_style)
50 : context_menu_contents_(this) { 50 : context_menu_contents_(this) {
51 Init(text, style::GetFont(text_context, text_style)); 51 Init(text, style::GetFont(text_context, text_style));
52 SetLineHeight(style::GetLineHeight(text_context, text_style));
52 } 53 }
53 54
54 Label::Label(const base::string16& text, const CustomFont& font) 55 Label::Label(const base::string16& text, const CustomFont& font)
55 : context_menu_contents_(this) { 56 : context_menu_contents_(this) {
56 Init(text, font.font_list); 57 Init(text, font.font_list);
57 } 58 }
58 59
59 Label::~Label() { 60 Label::~Label() {
60 } 61 }
61 62
(...skipping 996 matching lines...) Expand 10 before | Expand all | Expand 10 after
1058 .WriteText(GetSelectedText()); 1059 .WriteText(GetSelectedText());
1059 } 1060 }
1060 1061
1061 void Label::BuildContextMenuContents() { 1062 void Label::BuildContextMenuContents() {
1062 context_menu_contents_.AddItemWithStringId(IDS_APP_COPY, IDS_APP_COPY); 1063 context_menu_contents_.AddItemWithStringId(IDS_APP_COPY, IDS_APP_COPY);
1063 context_menu_contents_.AddItemWithStringId(IDS_APP_SELECT_ALL, 1064 context_menu_contents_.AddItemWithStringId(IDS_APP_SELECT_ALL,
1064 IDS_APP_SELECT_ALL); 1065 IDS_APP_SELECT_ALL);
1065 } 1066 }
1066 1067
1067 } // namespace views 1068 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/button/label_button.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698