Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5212)

Unified Diff: chrome/browser/sync/profile_sync_service.cc

Issue 388003002: Sync: Display non-severe errors on about:sync in gray color rather than red. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/profile_sync_service.cc
diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc
index cd24db0e80278c188cf754857b136e9bfc390a6c..0115dbf852ce461976a82c9632e39d6f14a40f30 100644
--- a/chrome/browser/sync/profile_sync_service.cc
+++ b/chrome/browser/sync/profile_sync_service.cc
@@ -957,14 +957,22 @@ void ProfileSyncService::DisableDatatype(
syncer::ModelType type,
const tracked_objects::Location& from_here,
std::string message) {
+ DisableDatatype(type, syncer::SyncError::DATATYPE_ERROR, from_here, message);
+}
+
+void ProfileSyncService::DisableDatatype(
+ syncer::ModelType type,
+ syncer::SyncError::ErrorType error_type,
+ const tracked_objects::Location& from_here,
+ std::string message) {
+ DCHECK(error_type == syncer::SyncError::DATATYPE_ERROR ||
+ error_type == syncer::SyncError::DATATYPE_POLICY_ERROR);
+
// First deactivate the type so that no further server changes are
// passed onto the change processor.
DeactivateDataType(type);
- syncer::SyncError error(from_here,
- syncer::SyncError::DATATYPE_ERROR,
- message,
- type);
+ syncer::SyncError error(from_here, error_type, message, type);
std::map<syncer::ModelType, syncer::SyncError> errors;
errors[type] = error;
@@ -1372,6 +1380,7 @@ void ProfileSyncService::OnEncryptedTypesChanged(
if (GetActiveDataTypes().Has(syncer::HISTORY_DELETE_DIRECTIVES) &&
encrypted_types_.Has(syncer::SESSIONS)) {
DisableDatatype(syncer::HISTORY_DELETE_DIRECTIVES,
+ syncer::SyncError::DATATYPE_POLICY_ERROR,
FROM_HERE,
"Delete directives not supported with encryption.");
}
@@ -1780,6 +1789,7 @@ void ProfileSyncService::OnUserChoseDatatypes(
if (GetActiveDataTypes().Has(syncer::HISTORY_DELETE_DIRECTIVES) &&
encrypted_types_.Has(syncer::SESSIONS)) {
DisableDatatype(syncer::HISTORY_DELETE_DIRECTIVES,
+ syncer::SyncError::DATATYPE_POLICY_ERROR,
FROM_HERE,
"Delete directives not supported with encryption.");
}
@@ -2026,10 +2036,22 @@ base::Value* ProfileSyncService::GetTypeStatusMap() const {
if (error_map.find(type) != error_map.end()) {
const syncer::SyncError &error = error_map.find(type)->second;
DCHECK(error.IsSet());
- std::string error_text = "Error: " + error.location().ToString() +
- ", " + error.message();
- type_status->SetString("status", "error");
- type_status->SetString("value", error_text);
+ switch (error.severity()) {
+ case logging::LOG_ERROR: {
+ std::string error_text = "Error: " + error.location().ToString() +
+ ", " + error.type_message_prefix() + error.message();
+ type_status->SetString("status", "error");
+ type_status->SetString("value", error_text);
+ }
+ break;
+ case logging::LOG_INFO:
+ type_status->SetString("status", "disabled");
+ type_status->SetString("value", error.message());
+ break;
+ default:
+ NOTREACHED() << "Unexpected error severity.";
+ break;
+ }
} else if (syncer::IsProxyType(type) && passive_types.Has(type)) {
// Show a proxy type in "ok" state unless it is disabled by user.
DCHECK(!throttled_types.Has(type));

Powered by Google App Engine
This is Rietveld 408576698