Only the green parts of the plant contains the toxin. So never eat of feed the stems, leaves or even the green unripe tomatoes. Ripe, red tomatoes are safe to eat.
I don't know if they are good for chameleons, but they don't contain the toxins found in the rest of the plant.
Other nightshade plants with eatable parts: potatoes, eggplant, peppers. - again the toxin is just in the green part.