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

  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
    @showing = true # The iframe is visible now.
    # Hide the iframe, but don't interfere with the focus.
    @hide false

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