| 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 #import <AppKit/AppKit.h> | 7 #import <AppKit/AppKit.h> |
| 8 #include <ApplicationServices/ApplicationServices.h> | 8 #include <ApplicationServices/ApplicationServices.h> |
| 9 #include <CoreText/CoreText.h> | 9 #include <CoreText/CoreText.h> |
| 10 | 10 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 SizeF RenderTextMac::GetStringSizeF() { | 106 SizeF RenderTextMac::GetStringSizeF() { |
| 107 EnsureLayout(); | 107 EnsureLayout(); |
| 108 return string_size_; | 108 return string_size_; |
| 109 } | 109 } |
| 110 | 110 |
| 111 SelectionModel RenderTextMac::FindCursorPosition(const Point& point) { | 111 SelectionModel RenderTextMac::FindCursorPosition(const Point& point) { |
| 112 // TODO(asvitkine): Implement this. http://crbug.com/131618 | 112 // TODO(asvitkine): Implement this. http://crbug.com/131618 |
| 113 return SelectionModel(); | 113 return SelectionModel(); |
| 114 } | 114 } |
| 115 | 115 |
| 116 bool RenderTextMac::IsSelectionSupported() const { |
| 117 return false; |
| 118 } |
| 119 |
| 116 std::vector<RenderText::FontSpan> RenderTextMac::GetFontSpansForTesting() { | 120 std::vector<RenderText::FontSpan> RenderTextMac::GetFontSpansForTesting() { |
| 117 EnsureLayout(); | 121 EnsureLayout(); |
| 118 if (!runs_valid_) | 122 if (!runs_valid_) |
| 119 ComputeRuns(); | 123 ComputeRuns(); |
| 120 | 124 |
| 121 std::vector<RenderText::FontSpan> spans; | 125 std::vector<RenderText::FontSpan> spans; |
| 122 for (size_t i = 0; i < runs_.size(); ++i) { | 126 for (size_t i = 0; i < runs_.size(); ++i) { |
| 123 const CFRange cf_range = CTRunGetStringRange(runs_[i].ct_run); | 127 const CFRange cf_range = CTRunGetStringRange(runs_[i].ct_run); |
| 124 const Range range(cf_range.location, cf_range.location + cf_range.length); | 128 const Range range(cf_range.location, cf_range.location + cf_range.length); |
| 125 spans.push_back(RenderText::FontSpan( | 129 spans.push_back(RenderText::FontSpan( |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 // TODO(karandeepb): This is not invoked on any codepath currently. Style the | 458 // TODO(karandeepb): This is not invoked on any codepath currently. Style the |
| 455 // returned text if need be. | 459 // returned text if need be. |
| 456 if (obscured()) | 460 if (obscured()) |
| 457 return false; | 461 return false; |
| 458 | 462 |
| 459 decorated_text->text = GetTextFromRange(range); | 463 decorated_text->text = GetTextFromRange(range); |
| 460 return true; | 464 return true; |
| 461 } | 465 } |
| 462 | 466 |
| 463 } // namespace gfx | 467 } // namespace gfx |
| OLD | NEW |