| 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 10 matching lines...) Expand all Loading... |
| 21 : common_baseline_(0), runs_valid_(false) { | 21 : common_baseline_(0), runs_valid_(false) { |
| 22 } | 22 } |
| 23 | 23 |
| 24 RenderTextMac::~RenderTextMac() { | 24 RenderTextMac::~RenderTextMac() { |
| 25 } | 25 } |
| 26 | 26 |
| 27 scoped_ptr<RenderText> RenderTextMac::CreateInstanceOfSameType() const { | 27 scoped_ptr<RenderText> RenderTextMac::CreateInstanceOfSameType() const { |
| 28 return make_scoped_ptr(new RenderTextMac); | 28 return make_scoped_ptr(new RenderTextMac); |
| 29 } | 29 } |
| 30 | 30 |
| 31 bool RenderTextMac::MultilineSupported() const { |
| 32 return false; |
| 33 } |
| 34 |
| 31 const base::string16& RenderTextMac::GetDisplayText() { | 35 const base::string16& RenderTextMac::GetDisplayText() { |
| 32 return text_elided() ? display_text() : layout_text(); | 36 return text_elided() ? display_text() : layout_text(); |
| 33 } | 37 } |
| 34 | 38 |
| 35 Size RenderTextMac::GetStringSize() { | 39 Size RenderTextMac::GetStringSize() { |
| 36 SizeF size_f = GetStringSizeF(); | 40 SizeF size_f = GetStringSizeF(); |
| 37 return Size(std::ceil(size_f.width()), size_f.height()); | 41 return Size(std::ceil(size_f.width()), size_f.height()); |
| 38 } | 42 } |
| 39 | 43 |
| 40 SizeF RenderTextMac::GetStringSizeF() { | 44 SizeF RenderTextMac::GetStringSizeF() { |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 CTUnderlineStyle value = kCTUnderlineStyleNone; | 385 CTUnderlineStyle value = kCTUnderlineStyleNone; |
| 382 if (underline && CFNumberGetValue(underline, kCFNumberSInt32Type, &value)) | 386 if (underline && CFNumberGetValue(underline, kCFNumberSInt32Type, &value)) |
| 383 run->underline = (value == kCTUnderlineStyleSingle); | 387 run->underline = (value == kCTUnderlineStyleSingle); |
| 384 | 388 |
| 385 run_origin.offset(run_width, 0); | 389 run_origin.offset(run_width, 0); |
| 386 } | 390 } |
| 387 runs_valid_ = true; | 391 runs_valid_ = true; |
| 388 } | 392 } |
| 389 | 393 |
| 390 } // namespace gfx | 394 } // namespace gfx |
| OLD | NEW |