     tab_apps = _filter_and_fetch_tabs(tab_objects)
 
     return native_apps.concat(tab_apps)
+
+  to_firebase_dict: (apps) ->
+    dict = {}
+    for app in apps
+      dict[app.get_firebase_key()] = app.get_firebase_value()
+    return dict

class RunningApp
  constructor: (@name) ->

  activate: () ->
    throw new Error('Not implemented')

  equals: (o) -> o? and @name == o.name

  constructor: (@window_index, @tab_index, @name) ->
    super(@name)

  get_firebase_value: () ->
    return {@window_index, @tab_index}

class NativeRunningApp extends RunningApp
  constructor: (@name) ->
    super(@name)

  get_firebase_value: () ->
    return 1


module.exports =
