atom_bundle_mover.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Copyright (c) 2017 GitHub, Inc.
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. #ifndef ATOM_BROWSER_UI_COCOA_ATOM_BUNDLE_MOVER_H_
  5. #define ATOM_BROWSER_UI_COCOA_ATOM_BUNDLE_MOVER_H_
  6. #include <string>
  7. #include "native_mate/persistent_dictionary.h"
  8. namespace atom {
  9. namespace ui {
  10. namespace cocoa {
  11. class AtomBundleMover {
  12. public:
  13. static bool Move(mate::Arguments* args);
  14. static bool IsCurrentAppInApplicationsFolder();
  15. private:
  16. static bool IsInApplicationsFolder(NSString* bundlePath);
  17. static NSString* ContainingDiskImageDevice(NSString* bundlePath);
  18. static void Relaunch(NSString* destinationPath);
  19. static NSString* ShellQuotedString(NSString* string);
  20. static bool CopyBundle(NSString* srcPath, NSString* dstPath);
  21. static bool AuthorizedInstall(NSString* srcPath,
  22. NSString* dstPath,
  23. bool* canceled);
  24. static bool IsApplicationAtPathRunning(NSString* bundlePath);
  25. static bool DeleteOrTrash(NSString* path);
  26. static bool Trash(NSString* path);
  27. };
  28. } // namespace cocoa
  29. } // namespace ui
  30. } // namespace atom
  31. #endif // ATOM_BROWSER_UI_COCOA_ATOM_BUNDLE_MOVER_H_