Commit 3fba85fe authored by Yue Li's avatar Yue Li Committed by Commit Bot

Add confirm reject screen and ready screen for Assistant OptIn flow

- Add two more screens for the flow.
- Update proto definitions

Bug: b/78190629
Test: Manual
Cq-Include-Trybots: luci.chromium.try:closure_compilation
Change-Id: Ic9a849e3184ea5b09e0f0f338a018caf2193d829
Reviewed-on: https://chromium-review.googlesource.com/1105469
Commit-Queue: Yue Li <updowndota@chromium.org>
Reviewed-by: default avatarXiaohui Chen <xiaohuic@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569397}
parent d02f85c1
......@@ -4710,7 +4710,37 @@
<message name="IDS_ASSISTANT_GET_MORE_SCREEN_TITLE" desc="Title for assistant get more screen.">
Get the most out of your Assistant
</message>
<message name="IDS_ASSISTANT_GET_MORE_SCREEN_CONTINUE_BUTTON" desc="Button label for accepting the get more screen.">
<message name="IDS_ASSISTANT_READY_SCREEN_TITLE" desc="Title for assistant ready screen.">
Your Assistant is ready
</message>
<message name="IDS_ASSISTANT_READY_SCREEN_MESSAGE" desc="Message for assistant ready screen.">
When your Chromebook is set up, press the Assistant button or say "OK Google" to get help from your Assistant anytime.
</message>
<message name="IDS_ASSISTANT_THIRD_PARTY_SCREEN_TITLE" desc="Title for assitant third party screen.">
Google Partners work with your Assistant to help you
</message>
<message name="IDS_ASSISTANT_CONFIRM_SCREEN_TITLE" desc="Title for assistant confirm screen.">
Get the full Assistant experience with these settings
</message>
<message name="IDS_ASSISTANT_CONFIRM_SCREEN_ACCEPT_TITLE" desc="Title for accept assistant confirm screen.">
Yes I'm In
</message>
<message name="IDS_ASSISTANT_CONFIRM_SCREEN_ACCEPT_MESSAGE" desc="Message for accept assistant confirm screen.">
To help you with your calendar, reminders, flights and more, your Assistant needs the Web &amp; App Activity, Device Information, Voice &amp; Audio Activity settings.
</message>
<message name="IDS_ASSISTANT_CONFIRM_SCREEN_ACCEPT_MESSAGE_EXPANDED" desc="Extra message for accept assistant confirm screen.">
Note: The data these settings control may be saved and used in any Google service where you are signed in to give you personalized experiences and useful ads. You can see your data, delete it and change your settings at account.google.com.
</message>
<message name="IDS_ASSISTANT_CONFIRM_SCREEN_REJECT_TITLE" desc="Title for reject assistant confirm screen.">
No Thanks
</message>
<message name="IDS_ASSISTANT_CONFIRM_SCREEN_REJECT_MESSAGE" desc="Message for reject assistant confirm screen.">
Depending on your account settings, your Assistant experience may be limited to things like web results, jokes, and local info.
</message>
<message name="IDS_ASSISTANT_CONTINUE_BUTTON" desc="Continue button for asssitant optin flow.">
Continue
</message>
<message name="IDS_ASSISTANT_DONE_BUTTON" desc="Done button for asssitant optin flow.">
Done
</message>
......
/* Copyright 2018 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file. */
#main-container {
height: 372px;
overflow: hidden;
padding: 48px 48px 0 48px;
position: absolute;
width: 480px;
}
img {
display: block;
height: 100px;
margin: auto;
}
.title {
font-size: 18px;
padding: 32px 0 18px 0;
}
.sub-title {
font-size: 12px;
}
.content {
color: rgba(0, 0, 0, .8);
font-size: 11px;
padding-top: 6px;
}
.extra-content {
color: rgba(0, 0, 0, .54);
font-size: 10px;
padding-top: 6px;
}
#accept,
#reject {
align-items: unset;
padding: 10px 0 10px 0;
}
#next-button {
-webkit-margin-end: 18px;
}
<!-- Copyright 2018 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<link rel="import" href="chrome://resources/cr_elements/cr_radio_button/cr_radio_button.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-radio-group/paper-radio-group.html">
<dom-module id="assistant-confirm-reject">
<template>
<link rel="stylesheet" href="../login/oobe_dialog_parameters.css">
<link rel="stylesheet" href="../login/oobe_flex_layout.css">
<link rel="stylesheet" href="assistant_confirm_reject.css">
<oobe-dialog id="confirm-reject-dialog" role="dialog" has-buttons
hide-shadow no-footer-padding no-header android>
<div slot="footer">
<div id="main-container">
<iron-icon src="assistant_logo.png">
</iron-icon>
<div class="title" id="title-text"></div>
<img src="assistant_confirm_reject.svg">
<paper-radio-group selected="accept" selectable="cr-radio-button">
<cr-radio-button id="accept" name="accept">
<div class="sub-title" id="accept-title-text"></div>
<div class="content" id="accept-message-text"></div>
<div class="extra-content" id="accept-message-extra-text"></div>
</cr-radio-button>
<cr-radio-button id="reject" name="reject">
<div class="sub-title" id="reject-title-text"></div>
<div class="content" id="reject-message-text"></div>
</cr-radio-button>
</paper-radio-group>
</div>
</div>
<div slot="bottom-buttons" class="flex layout horizontal">
<div class="flex"></div>
<oobe-text-button id="next-button" inverse android on-tap="onNextTap_"
disabled="[[buttonsDisabled]]" hidden="[[moreContents]]">
<div id="next-button-text"></div>
</oobe-text-button>
</div>
</oobe-dialog>
</template>
</dom-module>
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
* @fileoverview Polymer element for displaying material design assistant
* confirm reject screen.
*
* Event 'loading' will be fired when the page is loading/reloading.
* Event 'loaded' will be fired when the page has been successfully loaded.
*/
Polymer({
is: 'assistant-confirm-reject',
properties: {
/**
* Buttons are disabled when the page content is loading.
*/
buttonsDisabled: {
type: Boolean,
value: true,
},
},
/**
* Whether all the screen content has been successfully loaded.
* @type {boolean}
* @private
*/
pageLoaded_: false,
/**
* On-tap event handler for next button.
*
* @private
*/
onNextTap_: function() {
var confirmResult = this.$['accept'].getAttribute('checked') != null;
chrome.send('AssistantConfirmRejectScreen.userActed', [confirmResult]);
},
/**
* Reloads the page.
*/
reloadPage: function() {
this.fire('loading');
this.buttonsDisabled = true;
},
/**
* Reload the page with the given consent string text data.
*/
reloadContent: function(data) {
this.$['title-text'].textContent = data['confirmRejectTitle'];
this.$['next-button-text'].textContent =
data['confirmRejectContinueButton'];
this.$['accept-title-text'].textContent = data['confirmRejectAcceptTitle'];
this.$['accept-message-text'].textContent =
data['confirmRejectAcceptMessage'];
this.$['accept-message-extra-text'].textContent =
data['confirmRejectAcceptMessageExpanded'];
this.$['reject-title-text'].textContent = data['confirmRejectRejectTitle'];
this.$['reject-message-text'].textContent =
data['confirmRejectRejectMessage'];
this.pageLoaded_ = true;
this.onPageLoaded();
},
/**
* Handles event when all the page content has been loaded.
*/
onPageLoaded: function() {
this.fire('loaded');
this.buttonsDisabled = false;
this.$['next-button'].focus();
},
/**
* Signal from host to show the screen.
*/
onShow: function() {
if (!this.pageLoaded_) {
this.reloadPage();
} else {
this.$['next-button'].focus();
}
},
});
......@@ -2,60 +2,60 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file. */
#retry-button {
display: none;
}
.error #retry-button {
display: block;
}
#loading-container,
#error-container {
height: 372px;
overflow: hidden;
padding: 48px 48px 0 48px;
position: absolute;
visibility: hidden;
width: 480px;
}
.loading-animation #loading-container,
.error #error-container {
visibility: visible;
}
.loading #retry-button {
pointer-events: none;
}
.title {
font-size: 18px;
padding-bottom: 10px;
}
.sub-title {
font-size: 12px;
padding: 8px 0 8px 0;
}
#loading-message {
color: rgba(0, 0, 0, .54);
font-size: 12px;
line: 17px;
padding: 168px 0 0 0;
}
paper-progress {
--paper-progress-active-color: rgb(66, 133, 244);
--paper-progress-container-color: #CEE0FC;
--paper-progress-secondary-color: rgb(66, 133, 244);
display: block;
height: 3px;
padding: 4px 0 0 0;
width: 100%;
}
#retry-button {
-webkit-margin-end: 18px;
}
#retry-button {
display: none;
}
.error #retry-button {
display: block;
}
#loading-container,
#error-container {
height: 372px;
overflow: hidden;
padding: 48px 48px 0 48px;
position: absolute;
visibility: hidden;
width: 480px;
}
.loading-animation #loading-container,
.error #error-container {
visibility: visible;
}
.loading #retry-button {
pointer-events: none;
}
.title {
font-size: 18px;
padding-bottom: 10px;
}
.sub-title {
font-size: 12px;
padding: 8px 0 8px 0;
}
#loading-message {
color: rgba(0, 0, 0, .54);
font-size: 12px;
line: 17px;
padding: 168px 0 0 0;
}
paper-progress {
--paper-progress-active-color: rgb(66, 133, 244);
--paper-progress-container-color: #CEE0FC;
--paper-progress-secondary-color: rgb(66, 133, 244);
display: block;
height: 3px;
padding: 4px 0 0 0;
width: 100%;
}
#retry-button {
-webkit-margin-end: 18px;
}
......@@ -19,8 +19,10 @@
<include src="../login/oobe_buttons.html">
<include src="../login/oobe_change_picture.html">
<include src="../login/oobe_dialog.html">
<include src="assistant_confirm_reject.html">
<include src="assistant_get_more.html">
<include src="assistant_loading.html">
<include src="assistant_ready.html">
<include src="assistant_third_party.html">
<include src="assistant_value_prop.html">
<include src="setting_zippy.html">
......@@ -46,10 +48,14 @@
</assistant-loading>
<assistant-value-prop id="value-prop">
</assistant-value-prop>
<assistant-confirm-reject id="confirm-reject" hidden>
</assistant-confirm-reject>
<assistant-third-party id="third-party" hidden>
</assistant-third-party>
<assistant-get-more id="get-more" hidden>
</assistant-get-more>
<assistant-ready id="ready" hidden>
</assistant-ready>
</div>
<script src="chrome://resources/js/i18n_template.js"></script>
......
......@@ -8,8 +8,10 @@
// <include src="../login/oobe_dialog.js">
// <include src="utils.js">
// <include src="setting_zippy.js">
// <include src="assistant_confirm_reject.js">
// <include src="assistant_get_more.js">
// <include src="assistant_loading.js">
// <include src="assistant_ready.js">
// <include src="assistant_third_party.js">
// <include src="assistant_value_prop.js">
......@@ -40,6 +42,7 @@ cr.define('assistantOptin', function() {
loadTimeData.overrideValues(data);
i18nTemplate.process(document, loadTimeData);
$('value-prop').reloadContent(data);
$('confirm-reject').reloadContent(data);
$('third-party').reloadContent(data);
$('get-more').reloadContent(data);
},
......@@ -71,11 +74,21 @@ cr.define('assistantOptin', function() {
showNextScreen: function() {
switch (this.currentScreen) {
case $('value-prop'):
if ($('value-prop').userAccepted) {
this.showScreen($('third-party'));
} else {
this.showScreen($('confirm-reject'));
}
break;
case $('confirm-reject'):
this.showScreen($('third-party'));
break;
case $('third-party'):
this.showScreen($('get-more'));
break;
case $('get-more'):
this.showScreen($('ready'));
break;
default:
console.error('Undefined');
chrome.send('dialogClose');
......
/* Copyright 2018 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file. */
#main-container {
height: 372px;
overflow: hidden;
padding: 48px 48px 0 48px;
position: absolute;
width: 480px;
}
.title {
font-size: 18px;
padding-top: 32px;
}
.sub-title {
font-size: 12px;
padding-top: 12px;
}
img {
display: block;
height: 180px;
margin: auto;
padding: 48px 0 0 32px;
}
#next-button {
-webkit-margin-end: 18px;
}
<!-- Copyright 2018 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<dom-module id="assistant-ready">
<template>
<link rel="stylesheet" href="../login/oobe_dialog_parameters.css">
<link rel="stylesheet" href="../login/oobe_flex_layout.css">
<link rel="stylesheet" href="assistant_ready.css">
<oobe-dialog id="ready-dialog" role="dialog" has-buttons hide-shadow
no-footer-padding no-header android>
<div slot="footer">
<div id="main-container">
<iron-icon src="assistant_logo.png">
</iron-icon>
<div class="title" i18n-content="assistantReadyTitle"></div>
<div class="sub-title" i18n-content="assistantReadyMessage"></div>
<img src="assistant_ready.svg">
</div>
</div>
<div slot="bottom-buttons" class="flex layout horizontal">
<div class="flex"></div>
<oobe-text-button id="next-button" inverse android on-tap="onNextTap_"
disabled="[[buttonsDisabled]]" hidden="[[moreContents]]">
<div i18n-content="assistantReadyButton"></div>
</oobe-text-button>
</div>
</oobe-dialog>
</template>
</dom-module>
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
* @fileoverview Polymer element for displaying material design assistant
* ready screen.
*
*/
Polymer({
is: 'assistant-ready',
/**
* On-tap event handler for next button.
*
* @private
*/
onNextTap_: function() {
chrome.send('dialogClose');
},
/**
* Signal from host to show the screen.
*/
onShow: function() {
this.$['next-button'].focus();
},
});
<svg xmlns="http://www.w3.org/2000/svg" width="328" height="232">
<g fill="none" fill-rule="evenodd">
<path stroke="#DADCE0" stroke-width="3.211" d="M253.065 227.197H3m160.298 0H92.767c-4.87 0-8.817-3.954-8.817-8.831v-70.653c0-4.877 3.948-8.831 8.817-8.831h70.53c4.87 0 8.817 3.954 8.817 8.831v70.653c0 4.877-3.947 8.831-8.816 8.831z"/>
<path fill="#4285F4" d="M112.433 157.231c4.248-.724 8.77.383 12.175 3.037 3.43 2.621 5.697 6.714 6.064 11.027.417 4.294-1.038 8.727-3.93 11.927-3.032 3.433-7.62 5.411-12.195 5.229-4.553-.11-8.981-2.352-11.796-5.934-2.974-3.7-4.092-8.79-2.98-13.402 1.346-6.028 6.569-10.936 12.662-11.884"/>
<path fill="#34A853" d="M151.643 167.589c2.277-.819 4.946.987 5.052 3.397.24 2.19-1.693 4.278-3.888 4.19-2.188.062-4.098-2.03-3.849-4.206.097-1.54 1.223-2.923 2.685-3.381"/>
<path fill="#EA4335" d="M139.011 172.848c2.218-.624 4.711-.218 6.582 1.14 2.156 1.5 3.434 4.16 3.258 6.788-.116 2.449-1.494 4.778-3.553 6.093-2.864 1.887-6.955 1.543-9.436-.834-2.145-1.94-3.031-5.135-2.181-7.903.713-2.527 2.804-4.59 5.33-5.284"/>
<path fill="#FBBC05" d="M139.348 191.075c4.877-1.123 10.13 2.57 10.737 7.542.88 4.902-2.994 9.961-7.949 10.37-4.746.667-9.51-3.088-9.992-7.86-.697-4.572 2.665-9.247 7.204-10.052"/>
<path fill="#FFF" d="M11.915 36.083l37.161-9.974 9.958 37.224-37.161 9.975z"/>
<path fill="#E74133" d="M50.21 24.143L9.952 34.948l10.787 40.327 40.258-10.806L50.21 24.143zm-2.267 3.933l9.127 34.123-34.064 9.143-9.127-34.123 34.064-9.143z"/>
<path fill="#E74133" d="M51.98 36.967l-37.16 9.974-2.904-10.858 37.16-9.974zM33.208 53.642l-6.194 1.662-1.659-6.204 6.193-1.662z"/>
<path fill="#E74133" d="M15.316 30.184l-3.096.831 1.659 6.204 3.096-.831zM21.509 28.522l-3.096.831 1.659 6.204 3.097-.832zM27.703 26.859l-3.097.831 1.66 6.205 3.096-.831zM33.896 25.197l-3.097.831 1.66 6.204 3.097-.831zM40.09 23.534l-3.097.831 1.659 6.205 3.097-.831z"/>
<path fill="#EA4335" d="M46.284 21.872l-3.097.831 1.659 6.205 3.097-.832z"/>
<path stroke="#DADCE0" stroke-width="3.211" d="M285.926 84.287h-96.18c-22.131 0-40.074-17.973-40.074-40.144C149.672 21.973 167.615 4 189.747 4h96.179C308.058 4 326 21.973 326 44.143s-17.942 40.144-40.074 40.144z"/>
<path fill="#DADCE0" d="M192.953 101.95V84.287H218.6l-24.365 18.305a.801.801 0 0 1-1.282-.642"/>
<path stroke="#DADCE0" stroke-width="3.211" d="M181.732 34.509H293.94"/>
<path stroke="#34A853" stroke-width="3.211" d="M181.732 34.509h58.509"/>
<path stroke="#FBBC05" stroke-width="3.211" d="M181.732 53.778H293.94"/>
<path stroke="#EA4335" stroke-width="3.211" d="M181.732 53.778h78.546"/>
<path stroke="#4285F4" stroke-width="3.211" d="M181.732 53.778h39.273"/>
<path fill="#4285F4" d="M95.77 106.34a4.015 4.015 0 0 1-2.833 4.917 4.015 4.015 0 0 1-2.075-7.756 4.008 4.008 0 0 1 4.909 2.84"/>
<path stroke="#4285F4" stroke-width="3.211" d="M95.77 106.34a4.015 4.015 0 0 1-2.833 4.917 4.015 4.015 0 0 1-2.075-7.756 4.008 4.008 0 0 1 4.909 2.84zm0 0L89.34 82.3"/>
<path fill="#4285F4" d="M115.125 101.145a4.016 4.016 0 0 1-2.834 4.917 4.006 4.006 0 0 1-4.907-2.839 4.007 4.007 0 1 1 7.742-2.078"/>
<path stroke="#4285F4" stroke-width="3.211" d="M115.125 101.145a4.016 4.016 0 0 1-2.834 4.917 4.006 4.006 0 0 1-4.907-2.839 4.007 4.007 0 1 1 7.742-2.078zm0 0l-6.43-24.04"/>
<path fill="#4285F4" d="M89.34 82.3l1.245 4.653 20.515-5.507a4.819 4.819 0 0 0 3.401-5.9L89.341 82.3z"/>
<path stroke="#4285F4" stroke-width="3.211" d="M89.34 82.3l1.245 4.653 20.515-5.507a4.819 4.819 0 0 0 3.401-5.9L89.341 82.3z"/>
<path stroke="#34A853" stroke-width="3.211" d="M47.648 127c4.78 8.294 1.943 18.9-6.337 23.689-8.28 4.789-18.868 1.947-23.648-6.348-4.781-8.294-1.944-18.9 6.336-23.689 8.28-4.79 18.868-1.948 23.649 6.347z"/>
<path stroke="#34A853" stroke-width="3.211" d="M36.441 129.281l-3.071 11.483-5.223-1.402"/>
<path fill="#F1F3F4" d="M50.288 102.81l-5.667-5.677 5.667-5.678 5.667 5.678zM209.784 144.559l-5.667-5.677 5.667-5.678 5.667 5.678zM86.355 31.297a2.406 2.406 0 0 1-2.405 2.41 2.406 2.406 0 0 1-2.404-2.41 2.406 2.406 0 0 1 2.404-2.408 2.406 2.406 0 0 1 2.405 2.408m68.928 67.441a2.406 2.406 0 0 1-2.405 2.409 2.406 2.406 0 0 1-2.404-2.409 2.406 2.406 0 0 1 2.404-2.408 2.406 2.406 0 0 1 2.405 2.408"/>
</g>
</svg>
......@@ -34,7 +34,7 @@
<div class="flex"></div>
<oobe-text-button id="more-button" inverse android on-tap="onMoreTap_"
disabled="[[buttonsDisabled]]" hidden="[[!moreContents]]">
<div i18n-content="valuePropMoreButton"></div>
<div i18n-content="assistantOptinMoreButton"></div>
</oobe-text-button>
<oobe-text-button id="next-button" inverse android on-tap="onNextTap_"
disabled="[[buttonsDisabled]]" hidden="[[moreContents]]">
......
......@@ -46,6 +46,14 @@ Polymer({
type: Boolean,
value: false,
},
/**
* Whether user accept the activity control.
*/
userAccepted: {
type: Boolean,
value: true,
},
},
/**
......@@ -117,6 +125,7 @@ Polymer({
* @private
*/
onSkipTap_: function() {
this.userAccepted = false;
chrome.send('AssistantValuePropScreen.userActed', ['skip-pressed']);
},
......@@ -138,6 +147,7 @@ Polymer({
* @private
*/
onNextTap_: function() {
this.userAccepted = true;
chrome.send('AssistantValuePropScreen.userActed', ['next-pressed']);
},
......
......@@ -1935,8 +1935,12 @@ split_static_library("ui") {
"webui/chromeos/assistant_optin/assistant_optin_screen_exit_code.h",
"webui/chromeos/assistant_optin/assistant_optin_ui.cc",
"webui/chromeos/assistant_optin/assistant_optin_ui.h",
"webui/chromeos/assistant_optin/confirm_reject_screen_handler.cc",
"webui/chromeos/assistant_optin/confirm_reject_screen_handler.h",
"webui/chromeos/assistant_optin/get_more_screen_handler.cc",
"webui/chromeos/assistant_optin/get_more_screen_handler.h",
"webui/chromeos/assistant_optin/ready_screen_handler.cc",
"webui/chromeos/assistant_optin/ready_screen_handler.h",
"webui/chromeos/assistant_optin/third_party_screen_handler.cc",
"webui/chromeos/assistant_optin/third_party_screen_handler.h",
"webui/chromeos/assistant_optin/value_prop_screen_handler.cc",
......
......@@ -17,6 +17,8 @@ enum class AssistantOptInScreenExitCode {
THIRD_PARTY_CONTINUED = 2,
EMAIL_OPTED_IN = 3,
EMAIL_OPTED_OUT = 4,
CONFIRM_ACCEPTED = 5,
CONFIRM_REJECTED = 6,
EXIT_CODES_COUNT
};
......
......@@ -41,11 +41,12 @@ class AssistantOptInUI
// Called by a screen when user's done with it.
void OnExit(AssistantOptInScreenExitCode exit_code);
void OnActivityControlOptInResult(bool opted_in);
void OnEmailOptInResult(bool opted_in);
// Handle response from the settings manager.
void OnGetSettingsResponse(const std::string& settings);
void OnUpdateSettingsResponse(bool should_exit, const std::string& settings);
void OnUpdateSettingsResponse(const std::string& settings);
// Show next screen in the optin flow.
void Next();
......@@ -53,8 +54,8 @@ class AssistantOptInUI
// Consent token used to complete the opt-in.
std::string consent_token_;
// Whether activity controll is needed for user.
bool activity_controll_needed_ = true;
// Whether activity control is needed for user.
bool activity_control_needed_ = true;
// Whether email optin is needed for user.
bool email_optin_needed_ = false;
......
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/webui/chromeos/assistant_optin/confirm_reject_screen_handler.h"
#include "chrome/browser/browser_process.h"
#include "chrome/grit/generated_resources.h"
#include "components/login/localized_values_builder.h"
namespace {
constexpr char kJsScreenPath[] = "AssistantConfirmRejectScreen";
} // namespace
namespace chromeos {
ConfirmRejectScreenHandler::ConfirmRejectScreenHandler(
OnAssistantOptInScreenExitCallback callback)
: BaseWebUIHandler(), exit_callback_(std::move(callback)) {
set_call_js_prefix(kJsScreenPath);
}
ConfirmRejectScreenHandler::~ConfirmRejectScreenHandler() = default;
void ConfirmRejectScreenHandler::DeclareLocalizedValues(
::login::LocalizedValuesBuilder* builder) {}
void ConfirmRejectScreenHandler::RegisterMessages() {
AddPrefixedCallback("userActed",
&ConfirmRejectScreenHandler::HandleUserAction);
}
void ConfirmRejectScreenHandler::Initialize() {}
void ConfirmRejectScreenHandler::HandleUserAction(bool confirm_result) {
DCHECK(exit_callback_);
if (confirm_result) {
std::move(exit_callback_)
.Run(AssistantOptInScreenExitCode::CONFIRM_ACCEPTED);
} else {
std::move(exit_callback_)
.Run(AssistantOptInScreenExitCode::CONFIRM_REJECTED);
}
}
} // namespace chromeos
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_ASSISTANT_OPTIN_CONFIRM_REJECT_SCREEN_HANDLER_H_
#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_ASSISTANT_OPTIN_CONFIRM_REJECT_SCREEN_HANDLER_H_
#include <memory>
#include <string>
#include "base/macros.h"
#include "chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_screen_exit_code.h"
#include "chrome/browser/ui/webui/chromeos/login/base_webui_handler.h"
namespace chromeos {
class ConfirmRejectScreenHandler : public BaseWebUIHandler {
public:
explicit ConfirmRejectScreenHandler(
OnAssistantOptInScreenExitCallback callback);
~ConfirmRejectScreenHandler() override;
// BaseWebUIHandler:
void DeclareLocalizedValues(
::login::LocalizedValuesBuilder* builder) override;
void RegisterMessages() override;
void Initialize() override;
private:
void HandleUserAction(bool confirm_result);
OnAssistantOptInScreenExitCallback exit_callback_;
DISALLOW_COPY_AND_ASSIGN(ConfirmRejectScreenHandler);
};
} // namespace chromeos
#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_ASSISTANT_OPTIN_CONFIRM_REJECT_SCREEN_HANDLER_H_
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/webui/chromeos/assistant_optin/ready_screen_handler.h"
#include "chrome/browser/browser_process.h"
#include "chrome/grit/generated_resources.h"
#include "components/login/localized_values_builder.h"
namespace chromeos {
ReadyScreenHandler::ReadyScreenHandler() : BaseWebUIHandler() {}
ReadyScreenHandler::~ReadyScreenHandler() = default;
void ReadyScreenHandler::DeclareLocalizedValues(
::login::LocalizedValuesBuilder* builder) {
builder->Add("assistantReadyTitle", IDS_ASSISTANT_READY_SCREEN_TITLE);
builder->Add("assistantReadyMessage", IDS_ASSISTANT_READY_SCREEN_MESSAGE);
builder->Add("assistantReadyButton", IDS_ASSISTANT_DONE_BUTTON);
}
void ReadyScreenHandler::Initialize() {}
} // namespace chromeos
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_ASSISTANT_OPTIN_READY_SCREEN_HANDLER_H_
#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_ASSISTANT_OPTIN_READY_SCREEN_HANDLER_H_
#include <memory>
#include <string>
#include "base/macros.h"
#include "chrome/browser/ui/webui/chromeos/assistant_optin/assistant_optin_screen_exit_code.h"
#include "chrome/browser/ui/webui/chromeos/login/base_webui_handler.h"
namespace chromeos {
class ReadyScreenHandler : public BaseWebUIHandler {
public:
ReadyScreenHandler();
~ReadyScreenHandler() override;
// BaseWebUIHandler:
void DeclareLocalizedValues(
::login::LocalizedValuesBuilder* builder) override;
void Initialize() override;
private:
DISALLOW_COPY_AND_ASSIGN(ReadyScreenHandler);
};
} // namespace chromeos
#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_ASSISTANT_OPTIN_READY_SCREEN_HANDLER_H_
......@@ -40,7 +40,7 @@ void ValuePropScreenHandler::DeclareLocalizedValues(
IDS_VOICE_INTERACTION_VALUE_PROP_LOAD_ERROR_MESSAGE);
builder->Add("assistantOptinRetryButton",
IDS_VOICE_INTERACTION_VALUE_PROP_RETRY_BUTTON);
builder->Add("valuePropMoreButton",
builder->Add("assistantOptinMoreButton",
IDS_VOICE_INTERACTION_VALUE_PROP_MORE_BUTTION);
builder->Add("back", IDS_EULA_BACK_BUTTON);
builder->Add("next", IDS_EULA_NEXT_BUTTON);
......
......@@ -8,8 +8,6 @@ option optimize_for = LITE_RUNTIME;
package chromeos.assistant;
import "activity_control_settings_common.proto";
message ActivityControlSettingsUiSelector {
// An ID that uniquely identifies a single consent screen / client integration
// with consent flow.
......
......@@ -90,6 +90,63 @@ message ConsentFlowUi {
}
optional ActivityControlUi activity_control_ui = 1;
// A screen where we ask the user to confirm their intention to reject
// activity control.
// The client should only show if user rejects ActivityControlUi.
message ActivityControlConfirmRejectUi {
// Title for the whole page.
//
// Required.
optional string title = 1;
// Title for the option to opt in to ActivityControl.
//
// Required.
optional string accept_title = 2;
// Message for the option to opt in to ActivityControl.
//
// Required.
optional string accept_message = 3;
// Message for the option to opt in to ActivityControl in its expanded
// state. This extra text conveys some fine-print info about what will
// happen if the user accepts ActivityControl from this screen.
//
// Required
optional string accept_message_expanded = 4;
// A button that expands the accept message. In expanded state,
// both accept_message and accept_message_expanded are visible.
//
// Required.
optional string button_accept_expand = 5;
// A button that collapses the accept message. In collapsed state,
// accept_message is visible, but accept_message_expanded is not.
//
// Required.
optional string button_accept_collapse = 6;
// Title for the option to opt out of ActivityControl.
//
// Required.
optional string reject_title = 7;
// Message for the option to opt out of ActivityControl.
//
// Required.
optional string reject_message = 8;
// Text of the action button that lets the user commit their decision
// to accept or reject ActivityControl from the confirm page.
//
// Required.
optional string button_continue = 9;
}
optional ActivityControlConfirmRejectUi activity_control_confirm_reject_ui =
7;
// Represents the subsection of the ConsentUi that displays and conveys a
// disclosure that the user's account might be shared with third
// parties the user invokes in conversation/interaction with the Assistant.
......
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