I'd prefer this to be separated into non-Polymer- vs Polymer- specific behavior using the SparkDialog hierarchy in this file and spark_polymer.dart, but given how close we are to switching over, nevermind (and maybe I'll do it myself in a follow-up CL).