| 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_transient_te
xture.h" | 5 #include "chrome/browser/android/vr_shell/textures/insecure_content_transient_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/geometry/rect.h" | 12 #include "ui/gfx/geometry/rect.h" |
| 12 #include "ui/gfx/geometry/vector2d.h" | 13 #include "ui/gfx/geometry/vector2d.h" |
| 13 #include "ui/gfx/paint_vector_icon.h" | 14 #include "ui/gfx/paint_vector_icon.h" |
| 14 #include "ui/gfx/vector_icon_types.h" | 15 #include "ui/gfx/vector_icon_types.h" |
| 15 #include "ui/vector_icons/vector_icons.h" | 16 #include "ui/vector_icons/vector_icons.h" |
| 16 | 17 |
| 17 namespace vr_shell { | 18 namespace vr_shell { |
| 18 | 19 |
| 19 namespace { | 20 namespace { |
| 20 | 21 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 38 flags.setColor(kBackgroundColor); | 39 flags.setColor(kBackgroundColor); |
| 39 canvas->DrawRoundRect(gfx::Rect(texture_size_, height_), height_ * 0.1, | 40 canvas->DrawRoundRect(gfx::Rect(texture_size_, height_), height_ * 0.1, |
| 40 flags); | 41 flags); |
| 41 canvas->Save(); | 42 canvas->Save(); |
| 42 canvas->Translate({height_ * 0.1, height_ * 0.25}); | 43 canvas->Translate({height_ * 0.1, height_ * 0.25}); |
| 43 PaintVectorIcon(canvas, ui::kInfoOutlineIcon, height_ * 0.5, | 44 PaintVectorIcon(canvas, ui::kInfoOutlineIcon, height_ * 0.5, |
| 44 kForegroundColor); | 45 kForegroundColor); |
| 45 canvas->Restore(); | 46 canvas->Restore(); |
| 46 canvas->Save(); | 47 canvas->Save(); |
| 47 canvas->Translate({height_ * 0.7, height_ * 0.5}); | 48 canvas->Translate({height_ * 0.7, height_ * 0.5}); |
| 49 auto text = |
| 50 l10n_util::GetStringUTF16(IDS_PAGE_INFO_INSECURE_WEBVR_CONTENT_TRANSIENT); |
| 51 canvas->DrawStringRect(text, gfx::FontList(), kForegroundColor, |
| 52 gfx::Rect(0, 0, height_ * 1.2, height_ * 0.8)); |
| 53 /* |
| 48 flags.setColor(kForegroundColor); | 54 flags.setColor(kForegroundColor); |
| 49 flags.setTextSize(height_ * 0.1); | 55 flags.setTextSize(height_ * 0.1); |
| 50 auto text = | 56 auto text = |
| 51 l10n_util::GetStringUTF8(IDS_PAGE_INFO_INSECURE_WEBVR_CONTENT_TRANSIENT); | 57 l10n_util::GetStringUTF8(IDS_PAGE_INFO_INSECURE_WEBVR_CONTENT_TRANSIENT); |
| 52 DrawText(canvas, text, flags, height_ * 1.2, true); | 58 DrawText(canvas, text, flags, height_ * 1.2, true); |
| 59 */ |
| 53 canvas->Restore(); | 60 canvas->Restore(); |
| 54 } | 61 } |
| 55 | 62 |
| 56 void InsecureContentTransientTexture::SetSize() { | 63 void InsecureContentTransientTexture::SetSize() { |
| 57 size_.SetSize(texture_size_, height_); | 64 size_.SetSize(texture_size_, height_); |
| 58 } | 65 } |
| 59 | 66 |
| 60 } // namespace vr_shell | 67 } // namespace vr_shell |
| OLD | NEW |