     reader.readAsText file
 
   openLocalFile: (file, callback=null) ->
+    @_event 'willOpenFile', {op: "openLocalFile"}
     @readLocalFile file, (data) =>
       content = cloudContentFactory.createEnvelopedCloudContent data.content
       metadata = new CloudMetadata

    # trigger authorize() from confirmation dialog to avoid popup blockers
    @confirm tr("~CONFIRM.AUTHORIZE_OPEN"), =>
      provider.authorize =>
        provider.openSaved providerParams, (err, content, metadata) =>
          return @alert(err) if err
          @_fileOpened content, metadata, {openedContent: content.clone()}, @_getHashParams metadata


  openFile: (metadata, callback = null) ->
    if metadata?.provider?.can 'load', metadata
      @_event 'willOpenFile', {op: "openFile"}
      metadata.provider.load metadata, (err, content) =>
        return @alert(err, => @ready()) if err
        # should wait to close current file until client signals open is complete
