Commit 9d5958d2 authored by David Trainor's avatar David Trainor Committed by Commit Bot

Inline Updates: Show UI when downloading

Show a toast to the user when an inline update starts downloading.  This
currently has the side effect of reshowing whenever Chrome is started if
we're in the downloading state.

Bug: 934356
Change-Id: Ib83ac5cab8a1d66e234b5b55c0af76adbc92f72d
Reviewed-on: https://chromium-review.googlesource.com/c/1483706
Commit-Queue: Tommy Nyquist <nyquist@chromium.org>
Reviewed-by: default avatarMatthew Jones <mdjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#635817}
parent 54a4f733
......@@ -13,6 +13,7 @@ import org.chromium.chrome.browser.lifecycle.Destroyable;
import org.chromium.chrome.browser.omaha.UpdateStatusProvider.UpdateState;
import org.chromium.chrome.browser.omaha.UpdateStatusProvider.UpdateStatus;
import org.chromium.chrome.browser.tab.Tab;
import org.chromium.ui.widget.Toast;
/** Helper class that creates infobars based on {@link UpdateState} changes. */
public class UpdateInfoBarController implements Destroyable {
......@@ -52,6 +53,9 @@ public class UpdateInfoBarController implements Destroyable {
case UpdateState.INLINE_UPDATE_FAILED:
showFailedInfobar();
break;
case UpdateState.INLINE_UPDATE_DOWNLOADING:
showDownloadingToast();
break;
}
}
......@@ -123,4 +127,13 @@ public class UpdateInfoBarController implements Destroyable {
mActivity.getString(R.string.cancel) /* secondaryText */, null /* linkText */,
false /* autoExpire */);
}
private void showDownloadingToast() {
if (mActivity == null) return;
Toast.makeText(mActivity,
mActivity.getString(R.string.inline_update_toast_downloading_message),
Toast.LENGTH_LONG)
.show();
}
}
\ No newline at end of file
......@@ -1978,6 +1978,11 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
Couldn’t download the update
</message>
<!-- Inline Update Toast -->
<message name="IDS_INLINE_UPDATE_TOAST_DOWNLOADING_MESSAGE" desc="Text showing when the user starts the inline update process in Chrome which lets the user know that the update is downloading.">
Downloading Chrome Update…
</message>
<!-- TranslateInfoBar -->
<message name="IDS_TRANSLATE_INFOBAR_ERROR">
Oops. This page could not be translated.
......
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