| 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/view_text_utils.h" | 5 #include "ui/views/view_text_utils.h" |
| 6 | 6 |
| 7 #include "base/i18n/bidi_line_iterator.h" | 7 #include "base/i18n/bidi_line_iterator.h" |
| 8 #include "base/i18n/break_iterator.h" | 8 #include "base/i18n/break_iterator.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| 11 #include "ui/gfx/canvas_skia.h" | 11 #include "ui/gfx/canvas.h" |
| 12 #include "ui/gfx/font.h" | 12 #include "ui/gfx/font.h" |
| 13 #include "ui/gfx/rect.h" | 13 #include "ui/gfx/rect.h" |
| 14 #include "ui/gfx/size.h" | 14 #include "ui/gfx/size.h" |
| 15 #include "ui/views/controls/label.h" | 15 #include "ui/views/controls/label.h" |
| 16 #include "ui/views/controls/link.h" | 16 #include "ui/views/controls/link.h" |
| 17 | 17 |
| 18 namespace view_text_utils { | 18 namespace view_text_utils { |
| 19 | 19 |
| 20 void DrawTextAndPositionUrl(gfx::Canvas* canvas, | 20 void DrawTextAndPositionUrl(gfx::Canvas* canvas, |
| 21 views::Label* label, | 21 views::Label* label, |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 int font_height, | 149 int font_height, |
| 150 gfx::Size* position, | 150 gfx::Size* position, |
| 151 const gfx::Rect& bounds) { | 151 const gfx::Rect& bounds) { |
| 152 if (position->width() + word_width > bounds.right()) { | 152 if (position->width() + word_width > bounds.right()) { |
| 153 position->set_width(0); | 153 position->set_width(0); |
| 154 position->Enlarge(0, font_height); | 154 position->Enlarge(0, font_height); |
| 155 } | 155 } |
| 156 } | 156 } |
| 157 | 157 |
| 158 } // namespace view_text_utils | 158 } // namespace view_text_utils |
| OLD | NEW |