Commit 2682f8f9 authored by Roman Aleksandrov's avatar Roman Aleksandrov Committed by Commit Bot

RecommendAppsScreen: Remove error state.

Remove error state cause it wasn't in the UX proposal.

Bug: 1061098
Change-Id: I9d57b009f434611333d7b24f90af285470e6c95d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2139766
Commit-Queue: Roman Aleksandrov <raleksandrov@google.com>
Reviewed-by: default avatarRoman Sorokin [CET] <rsorokin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#757421}
parent 239eeaa8
......@@ -864,15 +864,9 @@
<message name="IDS_LOGIN_RECOMMEND_APPS_INSTALL" desc="The label on the button that installs the user selected apps">
Install &#38; continue
</message>
<message name="IDS_LOGIN_RECOMMEND_APPS_RETRY" desc="The label on the button that tries to load the app list again">
Retry
</message>
<message name="IDS_LOGIN_RECOMMEND_APPS_SCREEN_LOADING" desc="Message shown while the recommended app list is being downloaded.">
Please wait...
</message>
<message name="IDS_LOGIN_RECOMMEND_APPS_SCREEN_ERROR" desc="Load error message of the Recommend Apps OOBE dialog.">
The list of apps cannot be loaded. Please retry.
</message>
<message name="IDS_LOGIN_APP_DOWNLOADING_SCREEN_TITLE_SINGULAR" desc="The title of the dialog that tells the user the selected Android App is downloading.">
We'll install that app for you
</message>
......
......@@ -19,6 +19,8 @@ std::string RecommendAppsScreen::GetResultString(Result result) {
return "Selected";
case Result::SKIPPED:
return "Skipped";
case Result::LOAD_ERROR:
return "LoadError";
case Result::NOT_APPLICABLE:
return BaseScreen::kNotApplicable;
}
......@@ -45,10 +47,6 @@ void RecommendAppsScreen::OnSkip() {
exit_callback_.Run(Result::SKIPPED);
}
void RecommendAppsScreen::OnRetry() {
recommend_apps_fetcher_->Retry();
}
void RecommendAppsScreen::OnInstall() {
exit_callback_.Run(Result::SELECTED);
}
......@@ -90,8 +88,7 @@ void RecommendAppsScreen::OnLoadSuccess(const base::Value& app_list) {
}
void RecommendAppsScreen::OnLoadError() {
if (view_)
view_->OnLoadError();
exit_callback_.Run(Result::LOAD_ERROR);
}
void RecommendAppsScreen::OnParseResponseError() {
......
......@@ -27,7 +27,7 @@ class RecommendAppsScreenView;
class RecommendAppsScreen : public BaseScreen,
public RecommendAppsFetcherDelegate {
public:
enum class Result { SELECTED, SKIPPED, NOT_APPLICABLE };
enum class Result { SELECTED, SKIPPED, NOT_APPLICABLE, LOAD_ERROR };
static std::string GetResultString(Result result);
......
......@@ -1176,6 +1176,7 @@ void WizardController::OnRecommendAppsScreenExit(
break;
case RecommendAppsScreen::Result::SKIPPED:
case RecommendAppsScreen::Result::NOT_APPLICABLE:
case RecommendAppsScreen::Result::LOAD_ERROR:
ShowAssistantOptInFlowScreen();
break;
}
......
<svg version="1.1" viewBox="0 0 264 264" xmlns="http://www.w3.org/2000/svg">
<g fill="none" fill-rule="evenodd">
<path d="m171.6 82.336-6.413-6.413c-0.885-0.885-0.885-2.321 0-3.206l6.413-6.413c0.885-0.886 2.321-0.886 3.207 0l6.412 6.413c0.886 0.885 0.886 2.321 0 3.206l-6.412 6.413c-0.886 0.885-2.322 0.885-3.207 0" fill="#EA4335"/>
<path d="m105.87 48.101-6.413-6.413c-0.885-0.885-0.885-2.321 0-3.206l6.413-6.413c0.886-0.885 2.321-0.885 3.207 0l6.413 6.413c0.885 0.885 0.885 2.321 0 3.206l-6.413 6.413c-0.886 0.885-2.321 0.885-3.207 0" fill="#FBBC04"/>
<path d="m96.554 123.42 6.413-6.413c0.885-0.885 2.321-0.885 3.207 0l6.412 6.413c0.886 0.885 0.886 2.321 0 3.207l-6.412 6.412c-0.886 0.886-2.322 0.886-3.207 0l-6.413-6.412c-0.885-0.886-0.885-2.322 0-3.207" fill="#F1F3F4"/>
<path d="m129.01 65.679c-2.214-2.214-2.214-5.802 0-8.016l4.81-4.81c2.213-2.213 5.802-2.213 8.016 0 2.213 2.214 2.213 5.803 0 8.016l-4.81 4.81c-2.214 2.213-5.803 2.213-8.016 0" fill="#4285F4"/>
<path d="m133.77 102.36c-2.214-2.214-2.214-5.802 0-8.016l4.81-4.81c2.213-2.214 5.802-2.214 8.016 0 2.213 2.214 2.213 5.803 0 8.016l-4.81 4.81c-2.214 2.213-5.803 2.213-8.016 0" fill="#F1F3F4"/>
<path d="m146.85 97.289 0.741-0.741c2.214-2.214 2.214-5.802 0-8.016-2.213-2.213-5.803-2.213-8.016 0l-4.809 4.809c-0.745 0.745-1.217 1.651-1.461 2.602 4.621 0.068 9.146 0.527 13.545 1.346" fill="#FBBC04"/>
<path d="m87.07 75.282 11.947 3.201c1.686 0.452 2.25 2.559 1.016 3.793l-8.745 8.746c-1.235 1.234-3.342 0.67-3.794-1.016l-3.201-11.947c-0.452-1.686 1.091-3.229 2.777-2.777" fill="#34A853"/>
<path d="m151.38 118.92 11.947 3.201c1.686 0.452 2.25 2.559 1.016 3.793l-8.745 8.746c-1.235 1.234-3.342 0.67-3.794-1.016l-3.201-11.947c-0.452-1.686 1.091-3.229 2.777-2.777" fill="#F1F3F4"/>
<path d="m159 17c0 3.866-3.134 7-7 7s-7-3.134-7-7 3.134-7 7-7 7 3.134 7 7" fill="#34A853"/>
<path d="m212 175c0 44.183-35.817 80-80 80s-80-35.817-80-80 35.817-80 80-80 80 35.817 80 80z" stroke="#DADCE0" stroke-width="4"/>
<path d="m137 183.81 11.191-11.166 7.063 7.0791-23.394 23.341-23.393-23.341 7.0632-7.079 11.468 11.443v-35.086h10v34.809z" fill="#DADCE0" fill-rule="nonzero"/>
<path d="m101 151 62 62" stroke="#DADCE0" stroke-width="4"/>
</g>
</svg>
<svg version="1.1" viewBox="0 0 528 528" xmlns="http://www.w3.org/2000/svg">
<g fill="none" fill-rule="evenodd">
<path d="m343.21 164.67-12.826-12.826c-1.77-1.77-1.77-4.642 0-6.412l12.826-12.826c1.77-1.772 4.642-1.772 6.414 0l12.824 12.826c1.772 1.77 1.772 4.642 0 6.412l-12.824 12.826c-1.772 1.77-4.644 1.77-6.414 0" fill="#EA4335"/>
<path d="m211.74 96.202-12.826-12.826c-1.77-1.77-1.77-4.642 0-6.412l12.826-12.826c1.772-1.77 4.642-1.77 6.414 0l12.826 12.826c1.77 1.77 1.77 4.642 0 6.412l-12.826 12.826c-1.772 1.77-4.642 1.77-6.414 0" fill="#FBBC04"/>
<path d="m193.11 246.83 12.826-12.826c1.77-1.77 4.642-1.77 6.414 0l12.824 12.826c1.772 1.77 1.772 4.642 0 6.414l-12.824 12.824c-1.772 1.772-4.644 1.772-6.414 0l-12.826-12.824c-1.77-1.772-1.77-4.644 0-6.414" fill="#F1F3F4"/>
<path d="m258.02 131.36c-4.428-4.428-4.428-11.604 0-16.032l9.62-9.62c4.426-4.426 11.604-4.426 16.032 0 4.426 4.428 4.426 11.606 0 16.032l-9.62 9.62c-4.428 4.426-11.606 4.426-16.032 0" fill="#4285F4"/>
<path d="m267.53 204.72c-4.428-4.428-4.428-11.604 0-16.032l9.62-9.62c4.426-4.428 11.604-4.428 16.032 0 4.426 4.428 4.426 11.606 0 16.032l-9.62 9.62c-4.428 4.426-11.606 4.426-16.032 0" fill="#F1F3F4"/>
<path d="m293.7 194.58 1.482-1.482c4.428-4.428 4.428-11.604 0-16.032-4.426-4.426-11.606-4.426-16.032 0l-9.618 9.618c-1.49 1.49-2.434 3.302-2.922 5.204 9.242 0.136 18.292 1.054 27.09 2.692" fill="#FBBC04"/>
<path d="m174.14 150.56 23.894 6.402c3.372 0.904 4.5 5.118 2.032 7.586l-17.49 17.492c-2.47 2.468-6.684 1.34-7.588-2.032l-6.402-23.894c-0.904-3.372 2.182-6.458 5.554-5.554" fill="#34A853"/>
<path d="m302.77 237.85 23.894 6.402c3.372 0.904 4.5 5.118 2.032 7.586l-17.49 17.492c-2.47 2.468-6.684 1.34-7.588-2.032l-6.402-23.894c-0.904-3.372 2.182-6.458 5.554-5.554" fill="#F1F3F4"/>
<path d="m318 34c0 7.732-6.268 14-14 14s-14-6.268-14-14 6.268-14 14-14 14 6.268 14 14" fill="#34A853"/>
<path d="m424 350c0 88.366-71.634 160-160 160s-160-71.634-160-160 71.634-160 160-160 160 71.634 160 160z" stroke="#DADCE0" stroke-width="8"/>
<path d="m274 367.62 22.383-22.332 14.126 14.158-46.787 46.681-46.785-46.681 14.126-14.158 22.937 22.886v-70.172h20v69.618z" fill="#DADCE0" fill-rule="nonzero"/>
<path d="m202 302 124 124" stroke="#DADCE0" stroke-width="8"/>
</g>
</svg>
......@@ -15,11 +15,7 @@
.recommend-apps-loading #app-list-error,
.recommend-apps-loaded #recommend-apps-retry-button,
.recommend-apps-loading #recommend-apps-install-button,
.recommend-apps-loading #recommend-apps-retry-button,
.error #subtitle,
.error #app-list-view-container,
.error .app-list-loading,
.error #recommend-apps-install-button {
.recommend-apps-loading #recommend-apps-retry-button {
display: none;
}
......
......@@ -18,16 +18,6 @@
<iron-icon src="chrome://oobe/playstore.svg" slot="oobe-icon">
</iron-icon>
<div id="subtitle" slot="subtitle"></div>
<div id="app-list-error" slot="subtitle">
[[i18nDynamic(locale, 'recommendAppsError')]]
</div>
<div slot="footer" class="flex layout vertical center center-justified"
id="download-fail-illustration">
<img id="illustration"
srcset="images/1x/download_fail_illustration.svg 1x,
images/2x/download_fail_illustration.svg 2x"
class="oobe-illustration">
</div>
<div id="app-list-view-container" slot="footer">
<webview id="app-list-view"></webview>
</div>
......@@ -41,9 +31,6 @@
<oobe-next-button id="recommend-apps-install-button"
text-key="recommendAppsInstall" on-tap="onInstall_" inverse>
</oobe-next-button>
<oobe-text-button id="recommend-apps-retry-button"
text-key="recommendAppsRetry" on-tap="onRetry_" border inverse>
</oobe-text-button>
</div>
</oobe-dialog>
</template>
......
......@@ -40,11 +40,6 @@ Polymer({
this.screen.onInstall();
},
/** @private */
onRetry_() {
this.screen.onRetry();
},
/**
* Returns element by its id.
* @param id String The ID of the element.
......
......@@ -8,8 +8,7 @@
login.createScreen('RecommendAppsScreen', 'recommend-apps', function() {
return {
EXTERNAL_API:
['loadAppList', 'setThrobberVisible', 'setWebview', 'showError'],
EXTERNAL_API: ['loadAppList', 'setThrobberVisible', 'setWebview'],
/** Initial UI State for screen */
getOobeUIInitialState() {
......@@ -83,21 +82,6 @@ login.createScreen('RecommendAppsScreen', 'recommend-apps', function() {
window.addEventListener('message', this.onMessage);
},
/**
* Shows error UI when it fails to load the recommended app list.
*/
showError() {
this.ensureInitialized_();
// Hide the loading throbber and show the error message.
this.setThrobberVisible(false);
this.removeClass_('recommend-apps-loading');
this.removeClass_('recommend-apps-loaded');
this.addClass_('error');
this.getElement_('recommend-apps-retry-button').focus();
},
setWebview(contents) {
const appListView = this.getElement_('app-list-view');
appListView.src =
......@@ -149,7 +133,6 @@ login.createScreen('RecommendAppsScreen', 'recommend-apps', function() {
*/
onGenerateContents() {
this.removeClass_('recommend-apps-loading');
this.removeClass_('error');
this.addClass_('recommend-apps-loaded');
this.getElement_('recommend-apps-install-button').focus();
},
......@@ -176,18 +159,6 @@ login.createScreen('RecommendAppsScreen', 'recommend-apps', function() {
}
},
/**
* Handles Retry button click.
*/
onRetry() {
this.setThrobberVisible(true);
this.removeClass_('recommend-apps-loaded');
this.removeClass_('error');
this.addClass_('recommend-apps-loading');
chrome.send('recommendAppsRetry');
},
/**
* Handles the message sent from the WebView.
*/
......
......@@ -19,7 +19,6 @@
namespace {
constexpr const char kUserActionSkip[] = "recommendAppsSkip";
constexpr const char kUserActionRetry[] = "recommendAppsRetry";
constexpr const char kUserActionInstall[] = "recommendAppsInstall";
constexpr const int kMaxAppCount = 21;
......@@ -91,15 +90,12 @@ void RecommendAppsScreenHandler::DeclareLocalizedValues(
IDS_LOGIN_RECOMMEND_APPS_SCREEN_DESCRIPTION);
builder->Add("recommendAppsSkip", IDS_LOGIN_RECOMMEND_APPS_SKIP);
builder->Add("recommendAppsInstall", IDS_LOGIN_RECOMMEND_APPS_INSTALL);
builder->Add("recommendAppsRetry", IDS_LOGIN_RECOMMEND_APPS_RETRY);
builder->Add("recommendAppsLoading", IDS_LOGIN_RECOMMEND_APPS_SCREEN_LOADING);
builder->Add("recommendAppsError", IDS_LOGIN_RECOMMEND_APPS_SCREEN_ERROR);
}
void RecommendAppsScreenHandler::RegisterMessages() {
BaseScreenHandler::RegisterMessages();
AddCallback(kUserActionSkip, &RecommendAppsScreenHandler::OnUserSkip);
AddCallback(kUserActionRetry, &RecommendAppsScreenHandler::HandleRetry);
AddRawCallback(kUserActionInstall,
&RecommendAppsScreenHandler::HandleInstall);
}
......@@ -110,6 +106,10 @@ void RecommendAppsScreenHandler::Bind(RecommendAppsScreen* screen) {
}
void RecommendAppsScreenHandler::Show() {
if (!page_is_ready()) {
show_on_init_ = true;
return;
}
ShowScreen(kScreenId);
Profile* profile = ProfileManager::GetActiveUserProfile();
......@@ -118,11 +118,6 @@ void RecommendAppsScreenHandler::Show() {
void RecommendAppsScreenHandler::Hide() {}
void RecommendAppsScreenHandler::OnLoadError() {
RecordUmaScreenState(RecommendAppsScreenState::ERROR);
CallJS("login.RecommendAppsScreen.showError");
}
void RecommendAppsScreenHandler::OnLoadSuccess(const base::Value& app_list) {
recommended_app_count_ = static_cast<int>(app_list.GetList().size());
LoadAppListInUI(app_list);
......@@ -133,15 +128,14 @@ void RecommendAppsScreenHandler::OnParseResponseError() {
HandleSkip();
}
void RecommendAppsScreenHandler::Initialize() {}
void RecommendAppsScreenHandler::LoadAppListInUI(const base::Value& app_list) {
if (!page_is_ready()) {
RecordUmaScreenState(RecommendAppsScreenState::ERROR);
CallJS("login.RecommendAppsScreen.showError");
return;
void RecommendAppsScreenHandler::Initialize() {
if (show_on_init_) {
Show();
show_on_init_ = false;
}
}
void RecommendAppsScreenHandler::LoadAppListInUI(const base::Value& app_list) {
RecordUmaScreenState(RecommendAppsScreenState::SHOW);
const ui::ResourceBundle& resource_bundle =
ui::ResourceBundle::GetSharedInstance();
......@@ -166,12 +160,6 @@ void RecommendAppsScreenHandler::HandleSkip() {
screen_->OnSkip();
}
void RecommendAppsScreenHandler::HandleRetry() {
RecordUmaScreenAction(RecommendAppsScreenAction::RETRIED);
if (screen_)
screen_->OnRetry();
}
void RecommendAppsScreenHandler::HandleInstall(const base::ListValue* args) {
if (recommended_app_count_ != 0) {
int selected_app_count = static_cast<int>(args->GetSize());
......
......@@ -31,10 +31,6 @@ class RecommendAppsScreenView {
// Hides the contents of the screen.
virtual void Hide() = 0;
// Called when the download of the recommend app list fails. Show an error
// message to the user.
virtual void OnLoadError() = 0;
// Called when the download of the recommend app list is successful. Shows the
// downloaded |app_list| to the user.
virtual void OnLoadSuccess(const base::Value& app_list) = 0;
......@@ -62,7 +58,6 @@ class RecommendAppsScreenHandler : public BaseScreenHandler,
void Bind(RecommendAppsScreen* screen) override;
void Show() override;
void Hide() override;
void OnLoadError() override;
void OnLoadSuccess(const base::Value& app_list) override;
void OnParseResponseError() override;
......@@ -85,6 +80,9 @@ class RecommendAppsScreenHandler : public BaseScreenHandler,
int recommended_app_count_ = 0;
// If true, Initialize() will call Show().
bool show_on_init_ = false;
DISALLOW_COPY_AND_ASSIGN(RecommendAppsScreenHandler);
};
......
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