Commit 9126b2a1 authored by James Cook's avatar James Cook Committed by Commit Bot

Clean up unused PageStatus constants in PeopleHandler

PageStatus.TIMEOUT isn't used, so remove it and the associated HTML
content and string.

PageStatus.SPINNER is used as the default state for the page, but isn't
sent from C++, so eliminate the C++ constant.

Bug: none
Change-Id: I93b2dadb9bb6cf762faed3a825f0b2eda2ad4308
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2050033
Commit-Queue: Marc Treib <treib@chromium.org>
Auto-Submit: James Cook <jamescook@chromium.org>
Reviewed-by: default avatarMarc Treib <treib@chromium.org>
Cr-Commit-Position: refs/heads/master@{#740598}
parent 7c8d61ae
...@@ -4379,9 +4379,6 @@ ...@@ -4379,9 +4379,6 @@
<message name="IDS_SETTINGS_SYNC_SETUP_CANCEL_DIALOG_BODY" desc="The body text of the dialog to confirm the sync cancellation."> <message name="IDS_SETTINGS_SYNC_SETUP_CANCEL_DIALOG_BODY" desc="The body text of the dialog to confirm the sync cancellation.">
You can turn on sync anytime in settings You can turn on sync anytime in settings
</message> </message>
<message name="IDS_SETTINGS_SYNC_TIMEOUT" desc="Text explaining what to do if sync times out.">
Check your internet connection. If the problem continues, try signing out and signing in again.
</message>
<message name="IDS_SETTINGS_SYNC_EVERYTHING_CHECKBOX_LABEL" desc="Label for the checkbox which causes all properties to be synced."> <message name="IDS_SETTINGS_SYNC_EVERYTHING_CHECKBOX_LABEL" desc="Label for the checkbox which causes all properties to be synced.">
Sync everything Sync everything
</message> </message>
......
...@@ -92,7 +92,6 @@ cr.define('settings', function() { ...@@ -92,7 +92,6 @@ cr.define('settings', function() {
const PageStatus = { const PageStatus = {
SPINNER: 'spinner', // Before the page has loaded. SPINNER: 'spinner', // Before the page has loaded.
CONFIGURE: 'configure', // Preferences ready to be configured. CONFIGURE: 'configure', // Preferences ready to be configured.
TIMEOUT: 'timeout', // Preferences loading has timed out.
DONE: 'done', // Sync subpage can be closed now. DONE: 'done', // Sync subpage can be closed now.
PASSPHRASE_FAILED: 'passphraseFailed', // Error in the passphrase. PASSPHRASE_FAILED: 'passphraseFailed', // Error in the passphrase.
}; };
......
...@@ -180,10 +180,6 @@ ...@@ -180,10 +180,6 @@
hidden$="[[!isStatus_(pages_.SPINNER, pageStatus_)]]"> hidden$="[[!isStatus_(pages_.SPINNER, pageStatus_)]]">
$i18n{syncLoading} $i18n{syncLoading}
</div> </div>
<div id="[[pages_.TIMEOUT]]" class="settings-box first settings-box-text"
hidden$="[[!isStatus_(pages_.TIMEOUT, pageStatus_)]]">
$i18n{syncTimeout}
</div>
<div id="[[pages_.CONFIGURE]]" <div id="[[pages_.CONFIGURE]]"
hidden$="[[!isStatus_(pages_.CONFIGURE, pageStatus_)]]"> hidden$="[[!isStatus_(pages_.CONFIGURE, pageStatus_)]]">
<div id="other-sync-items" class="list-frame"> <div id="other-sync-items" class="list-frame">
......
...@@ -622,7 +622,6 @@ Polymer({ ...@@ -622,7 +622,6 @@ Polymer({
const router = settings.Router.getInstance(); const router = settings.Router.getInstance();
switch (pageStatus) { switch (pageStatus) {
case settings.PageStatus.SPINNER: case settings.PageStatus.SPINNER:
case settings.PageStatus.TIMEOUT:
case settings.PageStatus.CONFIGURE: case settings.PageStatus.CONFIGURE:
this.pageStatus_ = pageStatus; this.pageStatus_ = pageStatus;
return; return;
......
...@@ -262,9 +262,7 @@ base::string16 GetFullEncryptionBody(syncer::PassphraseType passphrase_type, ...@@ -262,9 +262,7 @@ base::string16 GetFullEncryptionBody(syncer::PassphraseType passphrase_type,
namespace settings { namespace settings {
// static // static
const char PeopleHandler::kSpinnerPageStatus[] = "spinner";
const char PeopleHandler::kConfigurePageStatus[] = "configure"; const char PeopleHandler::kConfigurePageStatus[] = "configure";
const char PeopleHandler::kTimeoutPageStatus[] = "timeout";
const char PeopleHandler::kDonePageStatus[] = "done"; const char PeopleHandler::kDonePageStatus[] = "done";
const char PeopleHandler::kPassphraseFailedPageStatus[] = "passphraseFailed"; const char PeopleHandler::kPassphraseFailedPageStatus[] = "passphraseFailed";
......
...@@ -48,13 +48,9 @@ class PeopleHandler : public SettingsPageUIHandler, ...@@ -48,13 +48,9 @@ class PeopleHandler : public SettingsPageUIHandler,
public: public:
// TODO(tommycli): Remove these strings and instead use WebUIListener events. // TODO(tommycli): Remove these strings and instead use WebUIListener events.
// These string constants are used from JavaScript (sync_browser_proxy.js). // These string constants are used from JavaScript (sync_browser_proxy.js).
static const char kSpinnerPageStatus[];
static const char kConfigurePageStatus[]; static const char kConfigurePageStatus[];
static const char kTimeoutPageStatus[];
static const char kDonePageStatus[]; static const char kDonePageStatus[];
static const char kPassphraseFailedPageStatus[]; static const char kPassphraseFailedPageStatus[];
// TODO(crbug.com/): Remove kSpinnerPageStatus and kTimeoutPageStatus (plus
// their JS-side handling); they're unused.
explicit PeopleHandler(Profile* profile); explicit PeopleHandler(Profile* profile);
~PeopleHandler() override; ~PeopleHandler() override;
......
...@@ -208,7 +208,6 @@ void AddSyncPageStrings(content::WebUIDataSource* html_source) { ...@@ -208,7 +208,6 @@ void AddSyncPageStrings(content::WebUIDataSource* html_source) {
{"syncLoading", IDS_SETTINGS_SYNC_LOADING}, {"syncLoading", IDS_SETTINGS_SYNC_LOADING},
{"themesAndWallpapersCheckboxLabel", {"themesAndWallpapersCheckboxLabel",
IDS_SETTINGS_THEMES_AND_WALLPAPERS_CHECKBOX_LABEL}, IDS_SETTINGS_THEMES_AND_WALLPAPERS_CHECKBOX_LABEL},
{"syncTimeout", IDS_SETTINGS_SYNC_TIMEOUT},
{"syncDataEncryptedText", IDS_SETTINGS_SYNC_DATA_ENCRYPTED_TEXT}, {"syncDataEncryptedText", IDS_SETTINGS_SYNC_DATA_ENCRYPTED_TEXT},
{"sync", IDS_SETTINGS_SYNC}, {"sync", IDS_SETTINGS_SYNC},
{"cancelSync", IDS_SETTINGS_SYNC_SETTINGS_CANCEL_SYNC}, {"cancelSync", IDS_SETTINGS_SYNC_SETTINGS_CANCEL_SYNC},
......
...@@ -48,7 +48,6 @@ cr.define('settings_people_page_sync_page', function() { ...@@ -48,7 +48,6 @@ cr.define('settings_people_page_sync_page', function() {
cr.webUIListenerCallback( cr.webUIListenerCallback(
'page-status-changed', settings.PageStatus.CONFIGURE); 'page-status-changed', settings.PageStatus.CONFIGURE);
assertFalse(syncPage.$$('#' + settings.PageStatus.CONFIGURE).hidden); assertFalse(syncPage.$$('#' + settings.PageStatus.CONFIGURE).hidden);
assertTrue(syncPage.$$('#' + settings.PageStatus.TIMEOUT).hidden);
assertTrue(syncPage.$$('#' + settings.PageStatus.SPINNER).hidden); assertTrue(syncPage.$$('#' + settings.PageStatus.SPINNER).hidden);
// Start with Sync All with no encryption selected. Also, ensure // Start with Sync All with no encryption selected. Also, ensure
...@@ -183,31 +182,23 @@ cr.define('settings_people_page_sync_page', function() { ...@@ -183,31 +182,23 @@ cr.define('settings_people_page_sync_page', function() {
test('LoadingAndTimeout', function() { test('LoadingAndTimeout', function() {
const configurePage = syncPage.$$('#' + settings.PageStatus.CONFIGURE); const configurePage = syncPage.$$('#' + settings.PageStatus.CONFIGURE);
const spinnerPage = syncPage.$$('#' + settings.PageStatus.SPINNER); const spinnerPage = syncPage.$$('#' + settings.PageStatus.SPINNER);
const timeoutPage = syncPage.$$('#' + settings.PageStatus.TIMEOUT);
// NOTE: This isn't called in production, but the test suite starts the
// tests with PageStatus.CONFIGURE.
cr.webUIListenerCallback( cr.webUIListenerCallback(
'page-status-changed', settings.PageStatus.SPINNER); 'page-status-changed', settings.PageStatus.SPINNER);
assertTrue(configurePage.hidden); assertTrue(configurePage.hidden);
assertTrue(timeoutPage.hidden);
assertFalse(spinnerPage.hidden); assertFalse(spinnerPage.hidden);
cr.webUIListenerCallback(
'page-status-changed', settings.PageStatus.TIMEOUT);
assertTrue(configurePage.hidden);
assertFalse(timeoutPage.hidden);
assertTrue(spinnerPage.hidden);
cr.webUIListenerCallback( cr.webUIListenerCallback(
'page-status-changed', settings.PageStatus.CONFIGURE); 'page-status-changed', settings.PageStatus.CONFIGURE);
assertFalse(configurePage.hidden); assertFalse(configurePage.hidden);
assertTrue(timeoutPage.hidden);
assertTrue(spinnerPage.hidden); assertTrue(spinnerPage.hidden);
// Should remain on the CONFIGURE page even if the passphrase failed. // Should remain on the CONFIGURE page even if the passphrase failed.
cr.webUIListenerCallback( cr.webUIListenerCallback(
'page-status-changed', settings.PageStatus.PASSPHRASE_FAILED); 'page-status-changed', settings.PageStatus.PASSPHRASE_FAILED);
assertFalse(configurePage.hidden); assertFalse(configurePage.hidden);
assertTrue(timeoutPage.hidden);
assertTrue(spinnerPage.hidden); assertTrue(spinnerPage.hidden);
}); });
......
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