diff options
author | lipalani@chromium.org <lipalani@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-30 19:48:44 +0000 |
---|---|---|
committer | lipalani@chromium.org <lipalani@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-30 19:48:44 +0000 |
commit | c121c1e1190cc8327ca99f83bb13faa6934cb846 (patch) | |
tree | e759f60d742a58455656a67c30dd17d7c45c63f1 | |
parent | c0e9a349d0b973b3ea59a576c16d6c23de3148ec (diff) | |
download | chromium_src-c121c1e1190cc8327ca99f83bb13faa6934cb846.zip chromium_src-c121c1e1190cc8327ca99f83bb13faa6934cb846.tar.gz chromium_src-c121c1e1190cc8327ca99f83bb13faa6934cb846.tar.bz2 |
Show actionable error only when there is an error.
Otherwise hide the content.
BUG=
TEST=
Review URL: http://codereview.chromium.org/9921022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129901 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/resources/sync_internals/about.html | 16 | ||||
-rw-r--r-- | chrome/browser/sync/sync_ui_util.cc | 34 |
2 files changed, 31 insertions, 19 deletions
diff --git a/chrome/browser/resources/sync_internals/about.html b/chrome/browser/resources/sync_internals/about.html index bf4bda5..e6ba344 100644 --- a/chrome/browser/resources/sync_internals/about.html +++ b/chrome/browser/resources/sync_internals/about.html @@ -91,12 +91,14 @@ table#aboutDetails tr[highlighted]:nth-child(odd) { </div> <div class="column"> - <h2>Actionable Error</h2> - <table id="actionableError"> - <tr jsselect="actionable_error"> - <td jscontent="stat_name"/> - <td jscontent="stat_value"/> - </tr> - </table> + <p jsdisplay="actionable_error_detected"> + <h2 jsdisplay="actionable_error_detected">Actionable Error</h2> + <table id="actionableError"> + <tr jsselect="actionable_error"> + <td jscontent="stat_name"/> + <td jscontent="stat_value"/> + </tr> + </table> + </p> </div> </div> diff --git a/chrome/browser/sync/sync_ui_util.cc b/chrome/browser/sync/sync_ui_util.cc index 777ccab..3024a4c 100644 --- a/chrome/browser/sync/sync_ui_util.cc +++ b/chrome/browser/sync/sync_ui_util.cc @@ -647,18 +647,28 @@ void ConstructAboutInformation(ProfileSyncService* service, } // Now set the actionable errors. - ListValue* actionable_error = new ListValue(); - strings->Set("actionable_error", actionable_error); - sync_ui_util::AddStringSyncDetails(actionable_error, "Error Type", - browser_sync::GetSyncErrorTypeString( - full_status.sync_protocol_error.error_type)); - sync_ui_util::AddStringSyncDetails(actionable_error, "Action", - browser_sync::GetClientActionString( - full_status.sync_protocol_error.action)); - sync_ui_util::AddStringSyncDetails(actionable_error, "url", - full_status.sync_protocol_error.url); - sync_ui_util::AddStringSyncDetails(actionable_error, "Error Description", - full_status.sync_protocol_error.error_description); + if ((full_status.sync_protocol_error.error_type != + browser_sync::UNKNOWN_ERROR) && + (full_status.sync_protocol_error.error_type != + browser_sync::SYNC_SUCCESS)) { + strings->Set("actionable_error_detected", + base::Value::CreateBooleanValue(true)); + ListValue* actionable_error = new ListValue(); + strings->Set("actionable_error", actionable_error); + sync_ui_util::AddStringSyncDetails(actionable_error, "Error Type", + browser_sync::GetSyncErrorTypeString( + full_status.sync_protocol_error.error_type)); + sync_ui_util::AddStringSyncDetails(actionable_error, "Action", + browser_sync::GetClientActionString( + full_status.sync_protocol_error.action)); + sync_ui_util::AddStringSyncDetails(actionable_error, "url", + full_status.sync_protocol_error.url); + sync_ui_util::AddStringSyncDetails(actionable_error, "Error Description", + full_status.sync_protocol_error.error_description); + } else { + strings->Set("actionable_error_detected", + base::Value::CreateBooleanValue(false)); + } const FailedDatatypesHandler& failed_datatypes_handler = service->failed_datatypes_handler(); |