So you have 3 wire sets here
- A line-in (from the circuit breaker or previous light fixture on the circuit)
- A line out (to the next light fixture in the circuit)
- A light switch
Just as a general FYI, you normally will have 2 line wires run to switches. So, for instance, it looks like you have a switch on the hot(black) wires. Because the wire in the wall to the switch will have a black and a white wire, you will want to hook the white to the black wires. It sounds backwards, but the logic here is that, when the current comes back through the wire (i.e. you flip the switch), you want to be able to hook it to the right wire (not terribly important for a basic light fixture, but a lot more important for, say, a ceiling fan).
In other words, it would be completely confusing if you pulled the fixture off and found it wired into two white wires. You would have to figure out which was the neutral and which was the switched hot.
Just hook it up as you're thinking. Black to black, white to white and your ground.