It's preferred for plants to be in pots, rather than planted directly into the cage. When they're in pots, it's easy to remove them and clean the enclosure. On the other hand, if they're planted into the enclosure itself with soil, it's easier to leave behind dead feeders or feces, which will grow bacteria, mold, fungus, etc. This would be even harder to upkeep with large rocks in there, where the feces or dead feeders could fall in between the rocks and become easily overlooked, until they're harboring mold and bacteria. Even if the chameleon doesn't come into direct contact with the soil, he can still acquire an illness or infection from the mold spores or bacteria that have reproduced within the cage. Also, the whole cage (soil) should not be moist all of the time. It should dry out completely in between mistings, which is difficult to manage when the whole cage is dirt with plants. Soil retains moisture and humidity, and the constant humidity would make them more susceptible to respiratory or skin infections as well.
Unless you're willing to take all the rocks out everyday, take all of the soil out to let it dry completely, and pick through it to remove all of the feces and dead, decomposing feeders, I would put the plants into pots. You still want to put rocks on the soil in the pots so he doesn't have access to it.