OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "views/widget/tooltip_manager.h" | 5 #include "ui/views/widget/tooltip_manager.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/string_split.h" | 9 #include "base/string_split.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
11 #include "ui/base/text/text_elider.h" | 11 #include "ui/base/text/text_elider.h" |
12 | 12 |
13 namespace { | 13 namespace { |
14 | 14 |
15 // Maximum number of characters we allow in a tooltip. | 15 // Maximum number of characters we allow in a tooltip. |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 string16 elided_text = ui::ElideText(*i, font, available_width, false); | 54 string16 elided_text = ui::ElideText(*i, font, available_width, false); |
55 *max_width = std::max(*max_width, font.GetStringWidth(elided_text)); | 55 *max_width = std::max(*max_width, font.GetStringWidth(elided_text)); |
56 if (!result.empty()) | 56 if (!result.empty()) |
57 result.push_back('\n'); | 57 result.push_back('\n'); |
58 result.append(elided_text); | 58 result.append(elided_text); |
59 } | 59 } |
60 *text = result; | 60 *text = result; |
61 } | 61 } |
62 | 62 |
63 } // namespace views | 63 } // namespace views |
OLD | NEW |