San Francisco bans smoking in public parks and, for that matter, in any public open space under the jurisdiction of a city department or the Recreation and Park Commission. When approved in 2004, the ban was one of the strictest to date. It applies to many public spaces: parks, squares, gardens, playing fields, piers, and farmers' markets. (Piers used for commercial purposes are not covered by the ban.)
Smoking is not allowed in playgrounds or "tot lot" sandbox areas, either, but that's by order of the California Health and Safety Code.