 { Frame } = require('sdk/ui/frame')
 { Toolbar } = require('sdk/ui/toolbar')
 { Panel } = require('sdk/panel')
-tabs = require('sdk/tabs')
+
+{ EventTarget } = require('sdk/event/target')
+{ emit } = require('sdk/event/core')
+
 preferences = require('sdk/simple-prefs').prefs
 { identify } = require('sdk/ui/id')
 _ = require('sdk/l10n').get

      menuitem.disabled = true for menuitem in @itemSpecific
      @activeItem = undefined

  # Helper method to handle messages from a view.
  # @private
  onNotifyClick : (item) =>
    @removeItem(item)
    tabs.open(item.link)
    if @displayedItems.length == 0 && preferences.hideOnEmpty
      @hideToolbar()
    else
      @send('REMOVE_ITEM', item)

  onShowDetails : (item, left) =>
    @details = Panel({
      width: 400,


# Manages the displayed items.
# Communicates with @see View instances running in the context of the UI's frame.
class ViewManager extends EventTarget
  # The list of items displayed in the toolbar.
  # @private
  displayedItems : []
