Chromium Code Reviews| 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 virtual ~RenderText(); | 212 virtual ~RenderText(); |
| 213 | 213 |
| 214 // The character used for displaying obscured text. | |
| 215 static const base::char16 kPasswordReplacementChar; | |
|
sky
2016/10/24 16:13:25
Style const says constants before destructor. Also
karandeepb
2016/10/25 03:31:03
Done. I initially preferred using a static const s
| |
| 216 | |
| 214 // Creates a platform-specific or cross-platform RenderText instance. | 217 // Creates a platform-specific or cross-platform RenderText instance. |
| 215 static RenderText* CreateInstance(); | 218 static RenderText* CreateInstance(); |
| 216 static RenderText* CreateInstanceForEditing(); | 219 static RenderText* CreateInstanceForEditing(); |
| 217 | 220 |
| 218 // Creates another instance of the same concrete class. | 221 // Creates another instance of the same concrete class. |
| 219 virtual std::unique_ptr<RenderText> CreateInstanceOfSameType() const = 0; | 222 virtual std::unique_ptr<RenderText> CreateInstanceOfSameType() const = 0; |
| 220 | 223 |
| 221 // Like above but copies all style settings too. | 224 // Like above but copies all style settings too. |
| 222 std::unique_ptr<RenderText> CreateInstanceOfSameStyle( | 225 std::unique_ptr<RenderText> CreateInstanceOfSameStyle( |
| 223 const base::string16& text) const; | 226 const base::string16& text) const; |
| (...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 842 // Lines computed by EnsureLayout. These should be invalidated upon | 845 // Lines computed by EnsureLayout. These should be invalidated upon |
| 843 // OnLayoutTextAttributeChanged and OnDisplayTextAttributeChanged calls. | 846 // OnLayoutTextAttributeChanged and OnDisplayTextAttributeChanged calls. |
| 844 std::vector<internal::Line> lines_; | 847 std::vector<internal::Line> lines_; |
| 845 | 848 |
| 846 DISALLOW_COPY_AND_ASSIGN(RenderText); | 849 DISALLOW_COPY_AND_ASSIGN(RenderText); |
| 847 }; | 850 }; |
| 848 | 851 |
| 849 } // namespace gfx | 852 } // namespace gfx |
| 850 | 853 |
| 851 #endif // UI_GFX_RENDER_TEXT_H_ | 854 #endif // UI_GFX_RENDER_TEXT_H_ |
| OLD | NEW |