Commit 2cd0fcc1 authored by updowndota's avatar updowndota Committed by Commit Bot

Rename buttons for voice interaction value prop screen

- Rename the 'no thanks' and 'continue' buttons to 'skip' and 'next'.
- Refactor the code.

BUG=b/63909126
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2984023002
Cr-Commit-Position: refs/heads/master@{#488741}
parent 79b662ab
......@@ -6162,11 +6162,8 @@ All users must sign out to continue.
<message name="IDS_VOICE_INTERACTION_VALUE_PROP_RETRY_BUTTON" desc="Button label for retry loading voice interaction value prop.">
Retry
</message>
<message name="IDS_VOICE_INTERACTION_VALUE_PROP_NO_THANKS_BUTTON" desc="Button label for skipping voice interaction value proposition.">
No thanks
</message>
<message name="IDS_VOICE_INTERACTION_VALUE_PROP_CONTINUE_BUTTION" desc="Button label for accepting voice interaction value proposition.">
Continue
<message name="IDS_VOICE_INTERACTION_VALUE_PROP_NEXT_BUTTION" desc="Button label for accepting voice interaction value proposition.">
Next
</message>
<message name="IDS_WAIT_FOR_CONTAINER_READY_TITLE" desc="Title of the wait for container ready OOBE screen.">
Just a sec
......
......@@ -16,8 +16,8 @@
namespace chromeos {
namespace {
constexpr const char kUserActionNoThanksPressed[] = "no-thanks-pressed";
constexpr const char kUserActionContinuePressed[] = "continue-pressed";
constexpr const char kUserActionSkipPressed[] = "skip-pressed";
constexpr const char kUserActionNextPressed[] = "next-pressed";
} // namespace
......@@ -64,15 +64,15 @@ void VoiceInteractionValuePropScreen::OnViewDestroyed(
void VoiceInteractionValuePropScreen::OnUserAction(
const std::string& action_id) {
if (action_id == kUserActionNoThanksPressed)
OnNoThanksPressed();
else if (action_id == kUserActionContinuePressed)
OnContinuePressed();
if (action_id == kUserActionSkipPressed)
OnSkipPressed();
else if (action_id == kUserActionNextPressed)
OnNextPressed();
else
BaseScreen::OnUserAction(action_id);
}
void VoiceInteractionValuePropScreen::OnNoThanksPressed() {
void VoiceInteractionValuePropScreen::OnSkipPressed() {
arc::ArcPaiStarter* pai_starter =
arc::ArcSessionManager::Get()->pai_starter();
if (pai_starter)
......@@ -80,7 +80,7 @@ void VoiceInteractionValuePropScreen::OnNoThanksPressed() {
Finish(ScreenExitCode::VOICE_INTERACTION_VALUE_PROP_SKIPPED);
}
void VoiceInteractionValuePropScreen::OnContinuePressed() {
void VoiceInteractionValuePropScreen::OnNextPressed() {
// Note! Release lock for PAI will be called at
// ArcVoiceInteractionArcHomeService::OnVoiceInteractionOobeSetupComplete.
ProfileManager::GetActiveUserProfile()->GetPrefs()->SetBoolean(
......
......@@ -30,8 +30,8 @@ class VoiceInteractionValuePropScreen : public BaseScreen {
void OnUserAction(const std::string& action_id) override;
private:
void OnNoThanksPressed();
void OnContinuePressed();
void OnSkipPressed();
void OnNextPressed();
VoiceInteractionValuePropScreenView* view_;
......
......@@ -10,11 +10,8 @@
}
.value-prop-loading #retry-button,
.value-prop-loading #skip-button,
.value-prop-loaded #retry-button,
.value-prop-loaded #skip-button,
.value-prop-error #continue-button,
.value-prop-error #no-thanks-button {
.value-prop-error #next-button {
display: none;
}
......@@ -33,9 +30,8 @@
}
.value-prop-loading #retry-button,
.value-prop-loading #skip-button,
.value-prop-loading #continue-button,
.value-prop-loading #no-thanks-button {
.value-prop-loading #next-button,
.value-prop-loading #skip-button {
pointer-events: none;
}
......@@ -69,14 +65,10 @@ paper-progress {
color: rgb(66, 133, 244);
}
#no-thanks-button {
color: rgb(66, 133, 244);
}
#retry-button {
-webkit-margin-end: 18px;
}
#continue-button {
#next-button {
-webkit-margin-end: 18px;
}
......@@ -28,22 +28,18 @@
</div>
</div>
<div class="bottom-buttons flex layout horizontal">
<oobe-text-button id="skip-button" android on-tap="onNoThanksTap_"
<oobe-text-button id="skip-button" android on-tap="onSkipTap_"
disabled="[[valuePropButtonsDisabled]]">
<div i18n-content="voiceInteractionValuePropSkipButton"></div>
</oobe-text-button>
<oobe-text-button id="no-thanks-button" android on-tap="onNoThanksTap_"
disabled="[[valuePropButtonsDisabled]]">
<div i18n-content="voiceInteractionValuePropNoThanksButton"></div>
</oobe-text-button>
<div class="flex"></div>
<oobe-text-button id="retry-button" inverse android on-tap="onRetryTap_"
disabled="[[valuePropButtonsDisabled]]">
<div i18n-content="voiceInteractionValuePropRetryButton"></div>
</oobe-text-button>
<oobe-text-button id="continue-button" inverse android
on-tap="onContinueTap_" disabled="[[valuePropButtonsDisabled]]">
<div i18n-content="voiceInteractionValuePropContinueButton"></div>
<oobe-text-button id="next-button" inverse android
on-tap="onNextTap_" disabled="[[valuePropButtonsDisabled]]">
<div i18n-content="voiceInteractionValuePropNextButton"></div>
</oobe-text-button>
</div>
</oobe-dialog>
......
......@@ -79,14 +79,13 @@ Polymer({
initialized_: false,
/**
* On-tap event handler for no thanks button.
* On-tap event handler for skip button.
*
* @private
*/
onNoThanksTap_: function() {
onSkipTap_: function() {
chrome.send(
'login.VoiceInteractionValuePropScreen.userActed',
['no-thanks-pressed']);
'login.VoiceInteractionValuePropScreen.userActed', ['skip-pressed']);
},
/**
......@@ -99,14 +98,13 @@ Polymer({
},
/**
* On-tap event handler for continue button.
* On-tap event handler for next button.
*
* @private
*/
onContinueTap_: function() {
onNextTap_: function() {
chrome.send(
'login.VoiceInteractionValuePropScreen.userActed',
['continue-pressed']);
'login.VoiceInteractionValuePropScreen.userActed', ['next-pressed']);
},
/**
......
......@@ -43,10 +43,8 @@ void VoiceInteractionValuePropScreenHandler::DeclareLocalizedValues(
IDS_VOICE_INTERACTION_VALUE_PROP_SKIP_BUTTON);
builder->Add("voiceInteractionValuePropRetryButton",
IDS_VOICE_INTERACTION_VALUE_PROP_RETRY_BUTTON);
builder->Add("voiceInteractionValuePropNoThanksButton",
IDS_VOICE_INTERACTION_VALUE_PROP_NO_THANKS_BUTTON);
builder->Add("voiceInteractionValuePropContinueButton",
IDS_VOICE_INTERACTION_VALUE_PROP_CONTINUE_BUTTION);
builder->Add("voiceInteractionValuePropNextButton",
IDS_VOICE_INTERACTION_VALUE_PROP_NEXT_BUTTION);
}
void VoiceInteractionValuePropScreenHandler::Bind(
......
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