| 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 #include "chrome/browser/android/vr_shell/textures/insecure_content_permanent_te
xture.h" | 5 #include "chrome/browser/android/vr_shell/textures/insecure_content_permanent_te
xture.h" |
| 6 | 6 |
| 7 #include "cc/paint/skia_paint_canvas.h" | 7 #include "cc/paint/skia_paint_canvas.h" |
| 8 #include "chrome/grit/generated_resources.h" | 8 #include "chrome/grit/generated_resources.h" |
| 9 #include "ui/base/l10n/l10n_util.h" | 9 #include "ui/base/l10n/l10n_util.h" |
| 10 #include "ui/gfx/canvas.h" | 10 #include "ui/gfx/canvas.h" |
| 11 #include "ui/gfx/font_list.h" | 11 #include "ui/gfx/font_list.h" |
| 12 #include "ui/gfx/geometry/rect.h" | 12 #include "ui/gfx/geometry/rect.h" |
| 13 #include "ui/gfx/geometry/vector2d.h" | 13 #include "ui/gfx/geometry/vector2d.h" |
| 14 #include "ui/gfx/paint_vector_icon.h" | 14 #include "ui/gfx/paint_vector_icon.h" |
| 15 #include "ui/gfx/vector_icon_types.h" | 15 #include "ui/gfx/vector_icon_types.h" |
| 16 #include "ui/vector_icons/vector_icons.h" | 16 #include "ui/vector_icons/vector_icons.h" |
| 17 | 17 |
| 18 namespace vr_shell { | 18 namespace vr_shell { |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 const SkColor kBackgroundColor = SK_ColorWHITE; | 22 const SkColor kBackgroundColor = SK_ColorWHITE; |
| 23 const SkColor kForegroundColor = 0xFF444444; | 23 const SkColor kForegroundColor = 0xFF444444; |
| 24 constexpr float kBorderFactor = 0.1; | 24 constexpr float kBorderFactor = 0.1; |
| 25 constexpr float kIconSizeFactor = 0.7; | 25 constexpr float kIconSizeFactor = 0.7; |
| 26 constexpr float kFontSizeFactor = 0.45; | 26 constexpr float kFontSizeFactor = 0.40; |
| 27 constexpr float kTextHeightFactor = 1.0 - 2 * kBorderFactor; | 27 constexpr float kTextHeightFactor = 1.0 - 2 * kBorderFactor; |
| 28 constexpr float kTextWidthFactor = 4.0 - 3 * kBorderFactor - kIconSizeFactor; | 28 constexpr float kTextWidthFactor = 4.0 - 3 * kBorderFactor - kIconSizeFactor; |
| 29 | 29 |
| 30 } // namespace | 30 } // namespace |
| 31 | 31 |
| 32 InsecureContentPermanentTexture::InsecureContentPermanentTexture() = default; | 32 InsecureContentPermanentTexture::InsecureContentPermanentTexture() = default; |
| 33 | 33 |
| 34 InsecureContentPermanentTexture::~InsecureContentPermanentTexture() = default; | 34 InsecureContentPermanentTexture::~InsecureContentPermanentTexture() = default; |
| 35 | 35 |
| 36 void InsecureContentPermanentTexture::Draw(gfx::Canvas* canvas, | 36 void InsecureContentPermanentTexture::Draw(gfx::Canvas* canvas, |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 // Ensuring height is a quarter of the width. | 84 // Ensuring height is a quarter of the width. |
| 85 int height = maximum_width / 4; | 85 int height = maximum_width / 4; |
| 86 return gfx::Size(height * 4, height); | 86 return gfx::Size(height * 4, height); |
| 87 } | 87 } |
| 88 | 88 |
| 89 gfx::SizeF InsecureContentPermanentTexture::GetDrawnSize() const { | 89 gfx::SizeF InsecureContentPermanentTexture::GetDrawnSize() const { |
| 90 return size_; | 90 return size_; |
| 91 } | 91 } |
| 92 | 92 |
| 93 } // namespace vr_shell | 93 } // namespace vr_shell |
| OLD | NEW |