400 feet you run the ECAM action and you secure the engine.
But... let's assume the engine fire does not go out. The light stays illuminated.
Incidentally unlike engine fail, in case of fire ECAM appears straight away. With fire at Vr after retracting the gear put the AP on and do the ECAM. However if you started the ECAM at 400ft by the time you fire the second shot and realize fire isn't gone you may be above 1000ft. It's silly to clean when you should be landing. Do an offset, turn around configure for downwind landing. After landing Evacuate.