   hide: (focusWindow=true)->
     if @showing
       @iframeElement.setAttribute "style", @hideStyle
-      # TODO(smblott) Is window always the right thing to focus, here?
       window.focus() if focusWindow
       @showing = false
 

    @iframeElement.src = chrome.runtime.getURL iframeUrl
    @iframeElement.addEventListener "load", => @openPort()
    document.documentElement.appendChild @iframeElement
    # Hide iframe, but don't interfere with the focus.
    @hide false

  # Open a port and pass it to the iframe via window.postMessage.

class UIComponent
  iframeElement: null
  iframePort: null
  showing: null
  showStyle: "display: block;"
  hideStyle: "display: none;"

