def _GetClearedFieldsForHeaderAction(header_action, field_prefix):
  """Gets a list of fields cleared by the user for HeaderAction."""
  cleared_fields = []
  if not header_action.requestHeadersToRemove:
    cleared_fields.append(field_prefix + 'requestHeadersToRemove')
  if not header_action.requestHeadersToAdd:
    cleared_fields.append(field_prefix + 'requestHeadersToAdd')
  if not header_action.responseHeadersToRemove:
    cleared_fields.append(field_prefix + 'responseHeadersToRemove')
  if not header_action.responseHeadersToAdd:
    cleared_fields.append(field_prefix + 'responseHeadersToAdd')
  return cleared_fields