The closest common ancestor of chameleons and frogs are primitive tetrapods which lived no less than 350 million years ago. The ballistic tongue projection mechanism in chameleons and frogs are independently evolved mechanisms and they are functionally quite different from each other. Tongue projection in salamanders is functionally more similar to chameleons, but actually opposite in anatomical arrangement and still independently evolved.
Chris