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