| 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 #ifndef UI_GFX_RENDER_TEXT_H_ | 5 #ifndef UI_GFX_RENDER_TEXT_H_ |
| 6 #define UI_GFX_RENDER_TEXT_H_ | 6 #define UI_GFX_RENDER_TEXT_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 SkPaint* paint); | 202 SkPaint* paint); |
| 203 | 203 |
| 204 } // namespace internal | 204 } // namespace internal |
| 205 | 205 |
| 206 // RenderText represents an abstract model of styled text and its corresponding | 206 // RenderText represents an abstract model of styled text and its corresponding |
| 207 // visual layout. Support is built in for a cursor, a selection, simple styling, | 207 // visual layout. Support is built in for a cursor, a selection, simple styling, |
| 208 // complex scripts, and bi-directional text. Implementations provide mechanisms | 208 // complex scripts, and bi-directional text. Implementations provide mechanisms |
| 209 // for rendering and translation between logical and visual data. | 209 // for rendering and translation between logical and visual data. |
| 210 class GFX_EXPORT RenderText { | 210 class GFX_EXPORT RenderText { |
| 211 public: | 211 public: |
| 212 // The character used for displaying obscured text. |
| 213 // TODO(benrg): GTK uses the first of U+25CF, U+2022, U+2731, U+273A, '*' |
| 214 // that's available in the font (find_invisible_char() in gtkentry.c). |
| 215 // Use a bullet character on Mac. |
| 216 #if defined(OS_MACOSX) |
| 217 static constexpr base::char16 kPasswordReplacementChar = 0x2022; |
| 218 #else |
| 219 static constexpr base::char16 kPasswordReplacementChar = '*'; |
| 220 #endif |
| 221 |
| 212 virtual ~RenderText(); | 222 virtual ~RenderText(); |
| 213 | 223 |
| 214 // Creates a platform-specific or cross-platform RenderText instance. | 224 // Creates a platform-specific or cross-platform RenderText instance. |
| 215 static RenderText* CreateInstance(); | 225 static RenderText* CreateInstance(); |
| 216 static RenderText* CreateInstanceForEditing(); | 226 static RenderText* CreateInstanceForEditing(); |
| 217 | 227 |
| 218 // Creates another instance of the same concrete class. | 228 // Creates another instance of the same concrete class. |
| 219 virtual std::unique_ptr<RenderText> CreateInstanceOfSameType() const = 0; | 229 virtual std::unique_ptr<RenderText> CreateInstanceOfSameType() const = 0; |
| 220 | 230 |
| 221 // Like above but copies all style settings too. | 231 // Like above but copies all style settings too. |
| (...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 842 // Lines computed by EnsureLayout. These should be invalidated upon | 852 // Lines computed by EnsureLayout. These should be invalidated upon |
| 843 // OnLayoutTextAttributeChanged and OnDisplayTextAttributeChanged calls. | 853 // OnLayoutTextAttributeChanged and OnDisplayTextAttributeChanged calls. |
| 844 std::vector<internal::Line> lines_; | 854 std::vector<internal::Line> lines_; |
| 845 | 855 |
| 846 DISALLOW_COPY_AND_ASSIGN(RenderText); | 856 DISALLOW_COPY_AND_ASSIGN(RenderText); |
| 847 }; | 857 }; |
| 848 | 858 |
| 849 } // namespace gfx | 859 } // namespace gfx |
| 850 | 860 |
| 851 #endif // UI_GFX_RENDER_TEXT_H_ | 861 #endif // UI_GFX_RENDER_TEXT_H_ |
| OLD | NEW |