       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 GoogleAnalytics.
  ###
  _initializeGoogleAnalytics = () ->
    Analytics.init {
      serviceName:   "RedmineTimeTracker"
      analyticsCode: "UA-32234486-7"
    }
    Analytics.sendView("/app/")

  ###
   initialize Data from chrome storage.
  ###
  _initializeDataFromChrome = () ->
    Log.debug "start initialize data."
    Option.loadOptions()
      .then(_initializeAccount)
      .then(_initializeProject)
      .then(_initializeIssues)
      .then(() -> Log.debug "finish initialize data.")

  ###
   Initialize account from chrome storage.

   Initialize project from chrome storage.
  ###
  _initializeProject = () ->
    Project.load()
      .then((projects) -> DataAdapter.addProjects(projects))

  ###
   Initialize issues status.
  ###
  _initializeIssues = () ->
    Ticket.load()
      .then((tickets) -> DataAdapter.toggleIsTicketShow(tickets))

  ###
   initialize Data from Redmine.
  ###
  _initializeDataFromRedmine = () ->
    Log.debug "[3] initializeDataFromRedmine start "
    accounts = DataAdapter.getAccount()
    $q.all(_loadRedmine(accounts))
      .finally(-> Log.debug "[3] initializeDataFromRedmine success")

  ###
   set datasync event to chrome alarms.
