       Ticket.syncLocal(DataAdapter.tickets)
     Option.onChanged('reportUsage', (e) -> Analytics.setPermission(e) )
     Option.onChanged('hideNonTicketProject',  _toggleProjectHidden)
-    Log.debug "finish initialize Event."
+    Log.debug "[4] initializeEvents success"
 
   ###
    load projects from redmine.

   initialize events.
  ###
  _initializeEvents = () ->
    Log.debug "start initialize Event."
    DataAdapter.addEventListener DataAdapter.ACCOUNT_ADDED, _loadRedmine
    DataAdapter.addEventListener DataAdapter.PROJECTS_CHANGED, () ->
      Project.syncLocal(DataAdapter.getProjects())

   initialize GoogleAnalytics.
  ###
  _initializeGoogleAnalytics = () ->
    Log.debug "[1] initializeGoogleAnalytics start"
    Analytics.init {
      serviceName:   "RedmineTimeTracker"
      analyticsCode: "UA-32234486-7"
    }
    Analytics.sendView("/app/")
    Log.debug "[1] initializeGoogleAnalytics success"

  ###
   initialize Data from chrome storage.
  ###
  _initializeDataFromChrome = () ->
    Log.debug "[2] initializeDataFromChrome start"
    Option.loadOptions()
      .then(_initializeAccount)
      .then(_initializeProject)
      .then(_initializeIssues)
      .then(() ->
        Log.debug "[2] initializeDataFromChrome success."
      , () ->
        Log.warn "[2] initializeDataFromChrome failed")

  ###
   Initialize account from chrome storage.
