Electrodeposition and surface treatment