Commit df333299 authored by mthiesse's avatar mthiesse Committed by Commit bot

VR: Make webVR insecure content warning look more like M58 warning.

This removes the info icon from the transient warning, and adjusts the element sizes and font sizes to more closely align with M58.

BUG=

Review-Url: https://codereview.chromium.org/2841333003
Cr-Commit-Position: refs/heads/master@{#468130}
parent bbfc047f
...@@ -23,7 +23,7 @@ const SkColor kBackgroundColor = SK_ColorWHITE; ...@@ -23,7 +23,7 @@ const SkColor kBackgroundColor = SK_ColorWHITE;
const SkColor kForegroundColor = 0xFF444444; const SkColor kForegroundColor = 0xFF444444;
constexpr float kBorderFactor = 0.1; constexpr float kBorderFactor = 0.1;
constexpr float kIconSizeFactor = 0.7; constexpr float kIconSizeFactor = 0.7;
constexpr float kFontSizeFactor = 0.45; constexpr float kFontSizeFactor = 0.40;
constexpr float kTextHeightFactor = 1.0 - 2 * kBorderFactor; constexpr float kTextHeightFactor = 1.0 - 2 * kBorderFactor;
constexpr float kTextWidthFactor = 4.0 - 3 * kBorderFactor - kIconSizeFactor; constexpr float kTextWidthFactor = 4.0 - 3 * kBorderFactor - kIconSizeFactor;
......
...@@ -22,9 +22,8 @@ namespace { ...@@ -22,9 +22,8 @@ namespace {
const SkColor kBackgroundColor = 0xCC1A1A1A; const SkColor kBackgroundColor = 0xCC1A1A1A;
const SkColor kForegroundColor = SK_ColorWHITE; const SkColor kForegroundColor = SK_ColorWHITE;
constexpr float kBorderFactor = 0.045; constexpr float kBorderFactor = 0.045;
constexpr float kIconSizeFactor = 0.25; constexpr float kFontSizeFactor = 0.048;
constexpr float kFontSizeFactor = 0.045; constexpr float kTextWidthFactor = 1.0 - 3 * kBorderFactor;
constexpr float kTextWidthFactor = 1.0 - 3 * kBorderFactor - kIconSizeFactor;
} // namespace } // namespace
...@@ -47,9 +46,7 @@ void InsecureContentTransientTexture::Draw(gfx::Canvas* canvas, ...@@ -47,9 +46,7 @@ void InsecureContentTransientTexture::Draw(gfx::Canvas* canvas,
int text_height = 0; // Will be increased during text measurement. int text_height = 0; // Will be increased during text measurement.
gfx::Canvas::SizeStringInt(text, fonts, &text_width, &text_height, 0, gfx::Canvas::SizeStringInt(text, fonts, &text_width, &text_height, 0,
text_flags); 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. // Making sure the drawing fits within the texture.
text_height = std::min( text_height = std::min(
text_height, static_cast<int>((1.0 - 2 * kBorderFactor) * size_.width())); text_height, static_cast<int>((1.0 - 2 * kBorderFactor) * size_.width()));
...@@ -59,19 +56,8 @@ void InsecureContentTransientTexture::Draw(gfx::Canvas* canvas, ...@@ -59,19 +56,8 @@ void InsecureContentTransientTexture::Draw(gfx::Canvas* canvas,
size_.height() * kBorderFactor, flags); size_.height() * kBorderFactor, flags);
canvas->Save(); canvas->Save();
canvas->Translate( canvas->Translate(gfx::Vector2d(size_.width() * kBorderFactor,
gfx::Vector2d(IsRTL() ? 2 * kBorderFactor * size_.width() + text_width size_.width() * kBorderFactor));
: 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->DrawStringRectWithFlags( canvas->DrawStringRectWithFlags(
text, fonts, kForegroundColor, text, fonts, kForegroundColor,
gfx::Rect(kTextWidthFactor * size_.width(), text_height), text_flags); gfx::Rect(kTextWidthFactor * size_.width(), text_height), text_flags);
......
...@@ -19,10 +19,10 @@ namespace { ...@@ -19,10 +19,10 @@ namespace {
static constexpr int kWarningTimeoutSeconds = 30; static constexpr int kWarningTimeoutSeconds = 30;
static constexpr float kWarningDistance = 0.7; static constexpr float kWarningDistance = 0.7;
static constexpr float kWarningAngleRadians = 16.3 * M_PI / 180.0; static constexpr float kWarningAngleRadians = 16.3 * M_PI / 180.0;
static constexpr float kPermanentWarningHeight = 0.226; static constexpr float kPermanentWarningHeight = 0.070f;
static constexpr float kPermanentWarningWidth = 0.078; static constexpr float kPermanentWarningWidth = 0.224f;
static constexpr float kTransientWarningHeight = 0.512; static constexpr float kTransientWarningHeight = 0.160;
static constexpr float kTransientWarningWidth = 0.160; static constexpr float kTransientWarningWidth = 0.512;
static constexpr float kContentWidth = 2.4; static constexpr float kContentWidth = 2.4;
static constexpr float kContentHeight = 1.6; static constexpr float kContentHeight = 1.6;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment