Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Unified Diff: chrome/browser/android/vr_shell/textures/insecure_content_transient_texture.cc

Issue 2841333003: VR: Make webVR insecure content warning look more like M58 warning. (Closed)
Patch Set: rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/vr_shell/textures/insecure_content_transient_texture.cc
diff --git a/chrome/browser/android/vr_shell/textures/insecure_content_transient_texture.cc b/chrome/browser/android/vr_shell/textures/insecure_content_transient_texture.cc
index 6c80c63b4b591b11797a32610c6d517da7be15ae..0557c2c5dfd494c9a708b015ba1c3239c0c8546d 100644
--- a/chrome/browser/android/vr_shell/textures/insecure_content_transient_texture.cc
+++ b/chrome/browser/android/vr_shell/textures/insecure_content_transient_texture.cc
@@ -22,9 +22,8 @@ namespace {
const SkColor kBackgroundColor = 0xCC1A1A1A;
const SkColor kForegroundColor = SK_ColorWHITE;
constexpr float kBorderFactor = 0.045;
-constexpr float kIconSizeFactor = 0.25;
-constexpr float kFontSizeFactor = 0.045;
-constexpr float kTextWidthFactor = 1.0 - 3 * kBorderFactor - kIconSizeFactor;
+constexpr float kFontSizeFactor = 0.048;
+constexpr float kTextWidthFactor = 1.0 - 3 * kBorderFactor;
} // namespace
@@ -47,9 +46,7 @@ void InsecureContentTransientTexture::Draw(gfx::Canvas* canvas,
int text_height = 0; // Will be increased during text measurement.
gfx::Canvas::SizeStringInt(text, fonts, &text_width, &text_height, 0,
text_flags);
- // Making sure that the icon fits in the box.
- text_height = std::max(
- text_height, static_cast<int>(ceil(size_.width() * kIconSizeFactor)));
+
// Making sure the drawing fits within the texture.
text_height = std::min(
text_height, static_cast<int>((1.0 - 2 * kBorderFactor) * size_.width()));
@@ -59,19 +56,8 @@ void InsecureContentTransientTexture::Draw(gfx::Canvas* canvas,
size_.height() * kBorderFactor, flags);
canvas->Save();
- canvas->Translate(
- gfx::Vector2d(IsRTL() ? 2 * kBorderFactor * size_.width() + text_width
- : size_.width() * kBorderFactor,
- (size_.height() - kIconSizeFactor * size_.width()) / 2.0));
- PaintVectorIcon(canvas, ui::kInfoOutlineIcon, size_.width() * kIconSizeFactor,
- kForegroundColor);
- canvas->Restore();
-
- canvas->Save();
- canvas->Translate(gfx::Vector2d(
- IsRTL() ? kBorderFactor * size_.width()
- : size_.width() * (2 * kBorderFactor + kIconSizeFactor),
- size_.width() * kBorderFactor));
+ canvas->Translate(gfx::Vector2d(size_.width() * kBorderFactor,
+ size_.width() * kBorderFactor));
canvas->DrawStringRectWithFlags(
text, fonts, kForegroundColor,
gfx::Rect(kTextWidthFactor * size_.width(), text_height), text_flags);

Powered by Google App Engine
This is Rietveld 408576698