| 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/gfx/render_text_mac.h" | 5 #include "ui/gfx/render_text_mac.h" |
| 6 | 6 |
| 7 #include <ApplicationServices/ApplicationServices.h> | 7 #include <ApplicationServices/ApplicationServices.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <cmath> | 10 #include <cmath> |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 } | 25 } |
| 26 | 26 |
| 27 scoped_ptr<RenderText> RenderTextMac::CreateInstanceOfSameType() const { | 27 scoped_ptr<RenderText> RenderTextMac::CreateInstanceOfSameType() const { |
| 28 return scoped_ptr<RenderTextMac>(new RenderTextMac); | 28 return scoped_ptr<RenderTextMac>(new RenderTextMac); |
| 29 } | 29 } |
| 30 | 30 |
| 31 const base::string16& RenderTextMac::GetDisplayText() { | 31 const base::string16& RenderTextMac::GetDisplayText() { |
| 32 return text_elided() ? display_text() : layout_text(); | 32 return text_elided() ? display_text() : layout_text(); |
| 33 } | 33 } |
| 34 | 34 |
| 35 bool RenderTextMac::MultilineSupported() const { |
| 36 return false; |
| 37 } |
| 38 |
| 35 Size RenderTextMac::GetStringSize() { | 39 Size RenderTextMac::GetStringSize() { |
| 36 EnsureLayout(); | 40 EnsureLayout(); |
| 37 return Size(std::ceil(string_size_.width()), string_size_.height()); | 41 return Size(std::ceil(string_size_.width()), string_size_.height()); |
| 38 } | 42 } |
| 39 | 43 |
| 40 SizeF RenderTextMac::GetStringSizeF() { | 44 SizeF RenderTextMac::GetStringSizeF() { |
| 41 EnsureLayout(); | 45 EnsureLayout(); |
| 42 return string_size_; | 46 return string_size_; |
| 43 } | 47 } |
| 44 | 48 |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 CTUnderlineStyle value = kCTUnderlineStyleNone; | 361 CTUnderlineStyle value = kCTUnderlineStyleNone; |
| 358 if (underline && CFNumberGetValue(underline, kCFNumberSInt32Type, &value)) | 362 if (underline && CFNumberGetValue(underline, kCFNumberSInt32Type, &value)) |
| 359 run->underline = (value == kCTUnderlineStyleSingle); | 363 run->underline = (value == kCTUnderlineStyleSingle); |
| 360 | 364 |
| 361 run_origin.offset(run_width, 0); | 365 run_origin.offset(run_width, 0); |
| 362 } | 366 } |
| 363 runs_valid_ = true; | 367 runs_valid_ = true; |
| 364 } | 368 } |
| 365 | 369 |
| 366 } // namespace gfx | 370 } // namespace gfx |
| OLD | NEW |