2017-08-31 14:37:12 +00:00
|
|
|
// Copyright (c) 2017 GitHub, Inc.
|
|
|
|
// Use of this source code is governed by the MIT license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2021-11-22 07:34:31 +00:00
|
|
|
#ifndef ELECTRON_SHELL_BROWSER_UI_COCOA_ELECTRON_BUNDLE_MOVER_H_
|
|
|
|
#define ELECTRON_SHELL_BROWSER_UI_COCOA_ELECTRON_BUNDLE_MOVER_H_
|
2020-02-04 20:19:40 +00:00
|
|
|
|
2019-09-06 05:52:54 +00:00
|
|
|
#include "base/mac/foundation_util.h"
|
|
|
|
#include "shell/common/gin_helper/error_thrower.h"
|
2017-08-31 14:37:12 +00:00
|
|
|
|
2019-09-06 05:52:54 +00:00
|
|
|
namespace gin {
|
|
|
|
class Arguments;
|
|
|
|
}
|
2017-08-31 14:37:12 +00:00
|
|
|
|
|
|
|
namespace electron {
|
|
|
|
|
2019-07-15 16:34:20 +00:00
|
|
|
// Possible bundle movement conflicts
|
2020-10-27 17:51:45 +00:00
|
|
|
enum class BundlerMoverConflictType { kExists, kExistsAndRunning };
|
2019-07-15 16:34:20 +00:00
|
|
|
|
2017-08-31 14:37:12 +00:00
|
|
|
class ElectronBundleMover {
|
|
|
|
public:
|
2019-09-06 05:52:54 +00:00
|
|
|
static bool Move(gin_helper::ErrorThrower thrower, gin::Arguments* args);
|
2017-08-31 14:37:12 +00:00
|
|
|
static bool IsCurrentAppInApplicationsFolder();
|
|
|
|
|
|
|
|
private:
|
2019-09-06 05:52:54 +00:00
|
|
|
static bool ShouldContinueMove(gin_helper::ErrorThrower thrower,
|
|
|
|
BundlerMoverConflictType type,
|
|
|
|
gin::Arguments* args);
|
2017-08-31 14:37:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace electron
|
|
|
|
|
2021-11-22 07:34:31 +00:00
|
|
|
#endif // ELECTRON_SHELL_BROWSER_UI_COCOA_ELECTRON_BUNDLE_MOVER_H_
|