For both. But it's perfectly possible to use an external power source and USB at the same time. Older Arduinos have a jumper, newer Arduinos switch automatically.