Skip to content

Commit

Permalink
Make Exit VR prompt button text to be uppercase
Browse files Browse the repository at this point in the history
The uppercase styling should be applied in code and not depend on the
actual strings. Leave the "EXIT VR" string unchanged for now.

Bug: 787654

Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: If265f4f6a6584f95bd0f6cdb39f26632875967a4
Reviewed-on: https://chromium-review.googlesource.com/780692
Reviewed-by: Ian Vollick <vollick@chromium.org>
Commit-Queue: David Dorwin <ddorwin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#518788}
  • Loading branch information
ddorwin authored and Commit Bot committed Nov 22, 2017
1 parent e543851 commit f2848d1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions chrome/app/generated_resources.grd
Original file line number Diff line number Diff line change
Expand Up @@ -11038,6 +11038,7 @@ For more information, visit our <ph name="BEGIN_LINK">&lt;a target="_blank" href
<message name="IDS_VR_SHELL_AUDIO_PERMISSION_PROMPT_CONTINUE_BUTTON" desc="Text on the exit button of the prompt that shows up when user needs to grant audio permission to Chrome to perform a voice search">
Continue
</message>
<!-- TODO(https://crbug.com/787654): Make mixed case before using in production on a non-Android platform. -->
<message name="IDS_VR_SHELL_EXIT_PROMPT_EXIT_VR_BUTTON" desc="Text on the exit button of the exit prompt that shows up when the user clicks on URL bar security icon in VR">
EXIT VR
</message>
Expand Down
2 changes: 2 additions & 0 deletions chrome/browser/vr/elements/audio_permission_prompt_texture.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ void AudioPermissionPromptTexture::Draw(SkCanvas* sk_canvas,
float radius = ToPixels(kButtonRadius);

// Secondary button area.
// TODO(https://crbug.com/787654): Uppercasing should be conditional.
text = base::i18n::ToUpper(l10n_util::GetStringUTF16(
IDS_VR_SHELL_AUDIO_PERMISSION_PROMPT_ABORT_BUTTON));
GetFontList(ToPixels(kFontSizePromptButtonText), text, &fonts);
Expand All @@ -113,6 +114,7 @@ void AudioPermissionPromptTexture::Draw(SkCanvas* sk_canvas,
canvas->Restore();

// Primary button area.
// TODO(https://crbug.com/787654): Uppercasing should be conditional.
text = base::i18n::ToUpper(l10n_util::GetStringUTF16(
IDS_VR_SHELL_AUDIO_PERMISSION_PROMPT_CONTINUE_BUTTON));
GetFontList(ToPixels(kFontSizePromptButtonText), text, &fonts);
Expand Down
8 changes: 6 additions & 2 deletions chrome/browser/vr/elements/exit_prompt_texture.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "chrome/browser/vr/elements/exit_prompt_texture.h"

#include "base/i18n/case_conversion.h"
#include "cc/paint/skia_paint_canvas.h"
#include "chrome/grit/generated_resources.h"
#include "components/strings/grit/components_strings.h"
Expand Down Expand Up @@ -60,7 +61,9 @@ void ExitPromptTexture::Draw(SkCanvas* sk_canvas,
float radius = size_.width() * kButtonRadiusFactor;

// Secondary button area.
text = l10n_util::GetStringUTF16(IDS_VR_SHELL_EXIT_PROMPT_EXIT_VR_BUTTON);
// TODO(https://crbug.com/787654): Uppercasing should be conditional.
text = base::i18n::ToUpper(
l10n_util::GetStringUTF16(IDS_VR_SHELL_EXIT_PROMPT_EXIT_VR_BUTTON));
GetFontList(ToPixels(kFontSizePromptButtonText), text, &fonts);
lines = PrepareDrawStringRect(
text, fonts, secondary_button_colors_.foreground, &button_text_size,
Expand All @@ -84,7 +87,8 @@ void ExitPromptTexture::Draw(SkCanvas* sk_canvas,
canvas->Restore();

// Primary button area.
text = l10n_util::GetStringUTF16(IDS_OK);
// TODO(https://crbug.com/787654): Uppercasing should be conditional.
text = base::i18n::ToUpper(l10n_util::GetStringUTF16(IDS_OK));
GetFontList(ToPixels(kFontSizePromptButtonText), text, &fonts);
button_text_size.set_size(gfx::Size(ToPixels(kButtonWidth), 0));
lines = PrepareDrawStringRect(text, fonts, primary_button_colors_.foreground,
Expand Down
1 change: 1 addition & 0 deletions chrome/browser/vr/ui_scene_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,7 @@ void UiSceneManager::CreateSplashScreen() {

timeout_text = base::MakeUnique<Text>(512, kTimeoutMessageTextFontHeightM,
kTimeoutButtonTextWidth);
// Disk-style button text is not uppercase. See crbug.com/787654.
timeout_text->SetText(
l10n_util::GetStringUTF16(IDS_VR_WEB_VR_EXIT_BUTTON_LABEL));
timeout_text->set_name(kWebVrTimeoutMessageButtonText);
Expand Down

0 comments on commit f2848d1

Please sign in to comment.