I knew you were going to ask me that. I can't remember the reason, but the subject of tomatoes has been brought up before and others who know have answered. Perhaps those others will chime in here or try a search on tomatoes and see if you get anything.
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.