| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_RENDER_TEXT_WRAPPER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_RENDER_TEXT_WRAPPER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_RENDER_TEXT_WRAPPER_H_ | 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_RENDER_TEXT_WRAPPER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "ui/gfx/render_text.h" | 9 #include "ui/gfx/render_text.h" |
| 10 | 10 |
| 11 namespace vr_shell { | 11 namespace vr_shell { |
| 12 | 12 |
| 13 // A minimal, mockable wrapper around gfx::RenderText, to facilitate testing of | 13 // A minimal, mockable wrapper around gfx::RenderText, to facilitate testing of |
| 14 // RenderText users. | 14 // RenderText users. |
| 15 class RenderTextWrapper { | 15 class RenderTextWrapper { |
| 16 public: | 16 public: |
| 17 explicit RenderTextWrapper(gfx::RenderText* render_text); | 17 explicit RenderTextWrapper(gfx::RenderText* render_text); |
| 18 virtual ~RenderTextWrapper(); | 18 virtual ~RenderTextWrapper(); |
| 19 | 19 |
| 20 virtual void SetColor(SkColor value); | 20 virtual void SetColor(SkColor value); |
| 21 virtual void ApplyColor(SkColor value, const gfx::Range& range); | 21 virtual void ApplyColor(SkColor value, const gfx::Range& range); |
| 22 | 22 |
| 23 virtual void SetStyle(gfx::TextStyle style, bool value); | 23 virtual void SetStyle(gfx::TextStyle style, bool value); |
| 24 virtual void ApplyStyle(gfx::TextStyle style, | 24 virtual void ApplyStyle(gfx::TextStyle style, |
| 25 bool value, | 25 bool value, |
| 26 const gfx::Range& range); | 26 const gfx::Range& range); |
| 27 | 27 |
| 28 virtual void SetStrikeThicknessFactor(SkScalar factor); |
| 29 |
| 28 private: | 30 private: |
| 29 gfx::RenderText* render_text_ = nullptr; | 31 gfx::RenderText* render_text_ = nullptr; |
| 30 | 32 |
| 31 DISALLOW_COPY_AND_ASSIGN(RenderTextWrapper); | 33 DISALLOW_COPY_AND_ASSIGN(RenderTextWrapper); |
| 32 }; | 34 }; |
| 33 | 35 |
| 34 } // namespace vr_shell | 36 } // namespace vr_shell |
| 35 | 37 |
| 36 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_RENDER_TEXT_WRAPPER_H_ | 38 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_TEXTURES_RENDER_TEXT_WRAPPER_H_ |
| OLD | NEW |