| 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 "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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |